1

What has been tried so far :

=query(dataset, "select Col1 where Col1='"&left(C1,3)&"' and Col2 is not null")

What I am trying to do :

=query(dataset, "select "&left(&"Col1"&,3)&" where Col1='"&left(C1,3)&"' and Col2 is not null")

I am trying to find display only first 3 letters of returned Column. I might want to use other formulas too. Is it a possibility in Google Sheets Query?

1
  • Welcome. Please remember that as per site guidelines when an answer addresses your question, you should accept it so others can benefit as well. Feb 3, 2020 at 10:48

1 Answer 1

0

EDIT: (following OP's request)

You can use (replacing C2:C10 with your corresponding column) the following:

=QUERY({ArrayFormula(LEFT(C2:C10,3)),dataset}, "select Col1, Col3 where  Col4 is not null")

Original answer

Try this formula instead:

=ArrayFormula(LEFT(QUERY(dataset, "select Col1 where Col2 is not null"),3))

You don't have to put the function LEFT inside the QUERY.

2
  • What if there are two or more columns that I want to select? Like select Col1,Col2 and I wish to display only first 3 letters of Col1?
    – eceo
    Feb 3, 2020 at 10:53
  • Please check the updated formula Feb 3, 2020 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.