Google-sheets – Google Sheets Query Searching

google sheetsgoogle-apps-scriptgoogle-sheets-queryimportrange

I'm trying to run a Query on some data that's being imported, and have it only Bring data over that matches the Email in the document.

This is my code:

=QUERY(IMPORTRANGE("SHEET ID REMOVED","'Form Responses 1'!$A$1:$O"),"SElECT * WHERE Col15 = 'TEST'",1)

Where it says TEST, I have a Script that pulls the Email, and places it in =YTD!B21

How can I get the Query to Import only the ranges that have the Attached Email?

Best Answer

I figured it out, after doing a lot of research.

=QUERY(IMPORTRANGE("SHEET ID REMOVED","'Form Responses 1'!$A$1:$O"),"SElECT * WHERE Col15 contains '"&YTD!B21&"'",1)