BY Column Function returning error on Query

Copper Contributor

I am running google sheets, Currently for this project.

 

I am using a query function to pull information based off an original response sheet to populate another sheet, however the column BY is a needed column in this populated sheet and is returning a query error.

 

=query('Form Responses 2021'!1:102, "select B,A,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,BU,BV,BW,BX,BY,BZ where C=""SSF""","1")

 

It works until I add the BY column and it returns the following error

#VALUE

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "by" "BY "" at line 1, column 84. Was expecting one of: "true" ... "false" ... "date" ... "timeofday" ... "datetime" ... "timestamp" ... "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ... <ID> ... <INTEGER_LITERAL> ... <DECIMAL_LITERAL> ... <STRING_LITERAL> ... <QUOTED_ID> ... "(" ... "-" ... "min" ... "max" ... "count" ... "avg" ... "sum" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "now" ... "dateDiff" ... "lower" ... "upper" ... "quarter" ... "dayOfWeek" ... "toDate" ... "(" ... <STRING_LITERAL> ... <DECIMAL_LITERAL> ... <INTEGER_LITERAL> ... "-" ... "true" ... "false" ... "date" ... "timeofday" ... "datetime" ... "timestamp" ... <ID> ... <QUOTED_ID> ... "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ...
 
 
How do I bypass this.
 
Granted I am using a form response sheet based off google forms so I do not think i can simply bypass it anywhere really unless I place a "filler" question that does not need to be reported.  But then its a useless question.
 
 
 
 
 
 
 
 
 
2 Replies

@DMills74  You realize this is a Microsoft Excel forum not a Google Sheets forum right?

I also use sheets but never used this "Query" function so looked it up to learn what it is and notice the last parameter is Number of Columns and you are passing "1".  Shouldn't that be a number and not text?

Yes I do understand this, however most people who are excel knowledgable are also fairly google sheet knowledgeable except a few nuances such as this query function from time to time, but it is not too much out of their scope and I can usually trust those on this forum over many others for great answers so I tend to dig a little here first.

 

Not quite sure your question However. Where C=""SSF"" is specifically looking for SSF in column C and returning the info based on the select function of Columns,  

The problem is the BY Column is apparently also a function of some sort where it changes the function to look for the error it shows.  Where BY is a column name it apparently triggers something in this particular query function.  No other Column I have found does this error