Search code examples
google-sheetsgoogle-sheets-queryimportrange

google sheets QUERY IMPORTRANGE where column = A1


I have a below query in my test google sheet that is importing all data that matches A1

=QUERY(IMPORTRANGE("sheed_ID","Master!A2:AG558"), "SELECT Col14 WHERE Col12 contains '"&$A$1&"'")

the problem is that the QUERY imports all cells that contain 'A1' as well as the top title cell from the col14.

How to avoid importing that title sheet_ID!N1/col14 cell? The N1 cell does not contain A1. It's just a header title cell.


Solution

  • I think you're forgetting the header option at the end of the query formula: =Query(Range,Query Operation, [Header])

    It is optional, so in your case if you want it to exclude the starting row, it will be:

    =QUERY(IMPORTRANGE("sheed_ID","Master!A2:AG558"), "SELECT Col14 WHERE Col12 contains '"&$A$1&"'",1)