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.

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. Dec 31, 2019 at 1:20

1 Answer 1

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)

Your Answer

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

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