2

I am trying to use one query to search in two nonconsecutive columns.
So far I have the below formula.

=QUERY(combine!A1:D,"SELECT * WHERE LOWER(A) LIKE LOWER("""&B1&""") or SELECT * WHERE LOWER(D) LIKE LOWER("""&B1&""")",1)

But I want to type in B1 different names that might be in column A or column D and there might be more than 20 rows with that name.

  • 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 Dec 31 '19 at 1:20
1

The SELECT and WHERE keywords should be included only once.

Try

=QUERY(combine!A1:D,"SELECT * WHERE LOWER(A) LIKE LOWER("""&B1&""") or LOWER(D) LIKE LOWER("""&B1&""")",1)

| improve this answer | |

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.