Search code examples
google-sheetsgoogle-sheets-formulagoogle-sheets-queryimportrange

Google sheet conditional importrange


I am trying to import rows from a sheet to another depending on the textual value of a column. After some research i find 2 methods to accomplish this : coupling the importrange function with the query function or the filter function. So, I try this formula in my sheet

=Query(importrange("URL";"Customer Data!a2:X");"select*where col6="textual_value"")

I already split my formula in 2 part so I could test my importrange function and it works, =importrange("URL";"Customer Data!a2:X") however it export all the sheet.

Considering this, I think there is an issue with my Query syntax.

Is there anyone who know how to solve this ?


Solution

  • You should try to use this formula instead:

    =QUERY(IMPORTRANGE("URL";"Customer Data!A2:X");"SELECT * WHERE Col6 = 'textual_value'; 0")
    

    Reference