I want to query data by checking if the data_range's column C (invoice#) matches this tab any value in column B (invoice#), while this tab column B will have variable data size ( copy from another list, it can be 2 values or 3 values or 10 values or etc. ).

Does anyone know how to achieve it? I tried

=QUERY('data'!A2:X,"SELECT * WHERE C IN '"&B3:B&"'", true)

but failed. Thanks so much!

enter image description here

  • This question has been bumped by Community user two times.
    – Rubén
    Oct 16 at 16:09

1 Answer 1


QUERY doesn't support the full set of SQL clauses in the select string so you can't use IN to evaluate multiple WHEREs. You can get the same result by using JOIN & MATCHES as I've outlined in this previous answer: https://stackoverflow.com/questions/76029347/google-query-language-seems-to-lack-an-equivalent-to-sqls-in/76029538#76029538

  • I see, thanks for helping!
    – Seth YEUNG
    May 22 at 1:49

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.