I have two spreadsheets and would like to enter a value into cell A1, have it check multiple columns in a spreadsheet named 'data' and output information from other columns if it's a match.

|  J. Smith  |   1    |     2     |   ABC    |
|  A. Smith  |   2    |     3     |   DEF    |

I was able to write the following to check only one column but can't seem to get an 'or' statement to work:

=query(data!A:B;"select A,D where B ="&A1;1)

1 Answer 1


I don't think your formula works at all, so I'm rather guessing what is required but would suggest you label your data source and in say D1 enter:

=query(data!A:D;"select A,B,C,D where B ="&$A1;1) 

Output example with A1 = 2:

WA54928 example

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.