Home > Software engineering >  Is there a list of column references that will break query functions in Google Sheets? (column BY, O
Is there a list of column references that will break query functions in Google Sheets? (column BY, O

Time:03-16

I am using column references in a Google Sheets query and realized that column BY (Col #77) breaks my query, as BY is a special word in querying. The solution is to enclose BY in quotations (`BY`) within the query. Today I realized that OR (Col #408) was breaking my query as well. Is there a way I can identify what these words are ahead of time? I'm guessing column AND is also problematic.

Thanks!

CodePudding user response:

In your situation, enclose the area with curly brackets and use ColX.

Example, replace =query(A:BY,"select A, BY") by =query({A:BY},"select Col1, Col77")

Note that x is not an absolute value but relative to the virtual matrix, i.e. =query({BX:BX,BY:BY,OR:OR},"select Col2, Col3 where Col1 is not null")

CodePudding user response:

see: enter image description here

CodePudding user response:

Mike's answer is a great workaround to this but if you're still looking for a list you can refer to the Google Sheets function list and their Query Language Reserved Words reference, so you can have an idea of what words are reserved in Sheets.

  • Related