1

I'm trying to figure out how to update the following Google Spreadsheets query function so it can search column "J" for three or more separate values. If any of the values are present in column "J", I need the query to return the 'select' data in column B, C, D, etc.

=query(data!B2:BK,"select B, C, D, E, F, G, H, I, J, K, L, M, N, BA where J = 'Guest Speaker'",false)

So if "J" equals Guest Speaker or Field Trip or Anything, it will return data from B, C, D, etc.

1 Answer 1

2

As query language documentation says,

You can join multiple conditions using the logical operators and, or, and not. Parentheses can be used to define explicit precedence.

Example:

select * where J = 'Guest Speaker' or J = 'Field Trip' or J = 'Anything'
4
  • is it possible to allow for any of the three but 'require' one of them? So it can be any of the three in column "J", but it also MUST to be something else in column "K". Thanks for your help!
    – Mr. B
    Jan 6, 2017 at 0:48
  • 1
    Do you mean like (J = 'this' or J = 'that' or J = 'another') and K = 'this one'?
    – user135384
    Jan 6, 2017 at 0:50
  • Thank you Zaq! I wasn't sure if or where I could use () to do that. Thanks again!
    – Mr. B
    Jan 6, 2017 at 0:52
  • 1
    No problem. It does say "Parentheses can be used to define explicit precedence." in the doc part I quoted.
    – user135384
    Jan 6, 2017 at 0:53

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.