google-sheetsgoogle-sheets-querygoogle-sheets-formula

Address BY column in query


How to access BY column in spreadsheet using query?

Background story: this query:

=query(A1:BZ10,"select A,B,C where (BY> 1))",1)

causes unable to parse error:

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "by" "BY "" at line 2, column 16. Was expecting one of: "true" ... "false" ...

Reason for parse error is because BY is interpreted as BY from group by etc.


Solution

  • use ` instead of () like:

    =QUERY(data!B2:CL, "select B, C, D, E, F, G, H, I, J, `BY`, BZ, CA, BA 
                        where J = 'Industry Certification'", 0)

    3