1

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

1

1 Answer 1

0

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

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

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.