Search code examples
google-sheetsgoogle-query-language

How to use where clause in QUERY built-in function


To begin here is the sheet : https://docs.google.com/spreadsheets/d/1VeDWvUk-4nc_AlI5-CeThYLVmrLUp2iGgmDVgmqxFog/edit#gid=0

I am trying to use a Google spreadsheet as a mini database. But whenever I try to do a where with another cell as the parameter it tells me I have it cannot parse the column. I am unsure of where my error is.

Here is the query.

=QUERY('Talents Data'!A:C, "select A Where B = E2")

Solution

  • Short answer

    Try

    =QUERY('Talents Data'!A:C, "select A Where B = '"&E2&"'")
    

    Explanation

    A cell reference should be out of literal string (do not enclose it by quotes).