Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google docs query when contains value in a range

In google sheets, I want to return a row when a cell in column C contains any value in a range on a different sheet.

The query below does not work. What am I missing?

=QUERY(
'Form Responses 1'!$1:$1000,
" select A:G where C contains 'Sheet2'!$A1:$A26"
)
like image 391
mordecai98 Avatar asked Oct 23 '25 16:10

mordecai98


1 Answers

If you are trying to match a string value in a range on a different sheet:

=query('Form Responses 1'!$1:$1000, "SELECT A,B,C,D,E,F,G WHERE A MATCHES '"&JOIN("|",'Sheet2'!$A1:$A26)&"'",1)

Hopefully syntax highlighting in the image below makes the above string concatenation operators a little clearer: GoogleSheets: Select partial row if target column in data set contains value within range declared in another sheet

like image 77
above-the-line Avatar answered Oct 27 '25 03:10

above-the-line



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!