1
votes

I'm trying to use submitted Google Form data in one spreadsheet to locate and retrieve data from another spreadsheet (tab in same document). The Google Spreadsheet file is here.

The =QUERY statement I'm trying to use is below

=QUERY(sheet2!A1:K; "Select B, C where A =" & B1  ; 0)

It works if I remove the 'cell reference' from where A =" & B1 ; 0) and I replace it with a 'static value' like where A contains '123456' ")

Any suggestions on 'how' to get the =QUERY to work using a 'cell referenced' value. The heading for the column being referenced is TEXT but the value of all rows below the heading is a NUMBER

Thank you in advance,

Todd

1
B1 is not a number, it is "Student ID #". Try to swap B1 for B2eddyparkinson

1 Answers

7
votes

I know this is old but I had the same issue and thought my solution might help others. Adding single brackets round the cell reference worked for me.

=Query(sheet2!A1:K, "select B, C where A ='"&B1&"'")