Search code examples
google-sheetsfilterimportgoogle-sheets-formulagoogle-query-language

Google Sheets get QUERY clause from IMPORTRANGE


I have a QUERY in Google Sheets, like:

=QUERY('Sheet1'!A:C, "select A where C <100")

That works perfect, BUT... what if I want to get this "100" value, from another document? Like:

=QUERY('Sheet1'!A:C, "select A where C < IMPORTRANGE("GoogleSheetURL", "Sheet!$A$1")")

I've tried with many syntax and ways to include this IMPORTRANGE in the clause, without success! =( It´s impossible??... or It´s just I'm doing it not as it is supossed to be done?


Solution

  • try:

    =QUERY('Sheet1'!A:C; 
     "select A 
      where C < "&IMPORTRANGE("GoogleSheetURL"; "Sheet!A1"))