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?

  • Welcome. Please remember that as per site guidelines when an answer addresses your question, you should accept it so others can benefit as well. – marikamitsos Feb 3 at 10:48
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.

  • 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 at 10:53
  • Please check the updated formula – marikamitsos Feb 3 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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