I\'m having trouble figuring out a fairly simple QUERY statement in Google Spreadsheets. I\'m trying to use a cell reference instead of static values and I\'m running into t
I only have a workaround here.
In this special case, I would use the FILTER
function instead of QUERY
:
=FILTER(Responses!B:B,Responses!G:G=B1)
Assuming that your data is on the "Responses" sheet, but your condition (cell reference) is in the actual sheet's B1 cell.
Hope it helps.
UPDATE:
After some search for the original question: The problem with your formula is definitely the second &
sign which assumes that you would like to concatenate something more to your WHERE
statement. Try to remove it. If it still doesn't work, then try this:
=QUERY(Responses!B1:I, "Select B where G matches '^.\*($" & B1 & ").\*$'")
- I have not tried it, but it helped in another post: Query with range of values for WHERE clause?