1
votes

I've been struggling with this Spreadsheets query problem for hours and even after rigorous googling, couldn't figure out what's wrong or how to do this properly. Here's an example of the problem:

=QUERY('Sheet2'!2:3, "select B where A="A2"")

Example Spreadsheet: https://docs.google.com/spreadsheets/d/172kaXIs0-OhWxhvI65OvnfM1jiLt6OdQVrGYDjxf6V8/edit?usp=sharing

What I'm trying to do is pull data from the Sheet2 so that I can also include the A2 cell from Sheet1 in the equation for better automation. I know there's a way to do it but I just can't seem to be able to make it work.

1

1 Answers

1
votes

The syntax is two pairs of quotes (each a single and a double) around concatenation with &. Please try:

=QUERY(Sheet2!2:3, "select B where A='"&A2&"' ")  

Your version should work if the actual content of A2 were A2.