Google Sheets QUERY Errors: Troubleshooting Guide
Fix common Google Sheets QUERY errors including parse errors, NO_COLUMN, mismatched array row size, mixed data types, headers, Col notation and ARRAY_LITERAL.
When QUERY fails, the formula bar usually shows a specific message. Match the message below, fix that cause, then re-check headers and data types—those two settings create many “mysterious” failures.
=QUERY(A1:C, "select * where A is not null", 1)
If the problem is only blank versus non-blank rows, start with blank, null and empty-string conditions. This page covers errors and type/header traps.
Unable to parse query string
Typical message:
Unable to parse query string for Function QUERY parameter 2: …
The second argument is invalid query language. Common causes:
| Mistake | Fix |
|---|---|
| Missing or mismatched quotes | Keep the whole query in double quotes; put string literals in single quotes: "select * where A = 'Open'" |
| Wrong clause spelling | Use select, where, group by, order by, limit, label, format |
Trailing comma in select | "select A, B" not "select A, B," |
Using == | Use =; both != and <> are valid not-equal operators |
| Locale decimal commas inside the query | Numeric literals often need a dot: B > 1.5 even when the sheet displays 1,5 |
| Broken concatenation when inserting a cell | Close the double-quoted fragment, concatenate with &, reopen quotes—see WHERE with a cell value |
Minimal valid shape:
=QUERY(A1:C10, "select A, B where C > 0 order by B desc", 1)
NO_COLUMN
Typical message:
Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: …
QUERY cannot find the column you named.
Letter vs Col notation
- Plain ranges such as
A1:Cuse letters:select A, B where C is not null. - Array literals and noncontiguous sets such as
{A:A, C:C}useCol1,Col2, … in order—not sheet letters:
=QUERY({A2:A, C2:C}, "select Col1, Col2 where Col2 is not null", 0)
Col must be capitalised exactly that way. Details and examples: multiple ranges in QUERY.
String values without single quotes
A missing quote around a text comparison is often reported as NO_COLUMN because the engine misreads the next token:
// Wrong
=QUERY(A1:B, "select * where A = Open", 1)
// Right
=QUERY(A1:B, "select * where A = 'Open'", 1)
// Cell reference for text
=QUERY(A1:B, "select * where A = '"&E1&"'", 1)
Column outside the range
select D fails if the data range is only A1:C. Widen the range or drop the extra column.
Mismatched array row size
Typical message:
Function ARRAY_ROW parameter 2 has mismatched row size. Expected: N. Actual: M.
This appears when building the data argument with {...} and the pieces do not share the same height:
// Fails if A1:A10 and C1:C8 have different row counts
=QUERY({A1:A10, C1:C8}, "select Col1, Col2", 0)
Give every horizontal piece the same number of rows:
=QUERY({A1:A10, C1:C10}, "select Col1, Col2", 0)
Stacking ranges vertically uses ; (or locale equivalent) and requires matching column counts. See concatenate multiple ranges and noncontiguous QUERY ranges.
ARRAY_LITERAL missing values
Typical message:
In ARRAY_LITERAL, an array literal was missing values for one or more rows.
The {...} construction has uneven row lengths or an empty hole:
// Broken — rows have different widths
={A1:B2; C1:C2}
// Valid — each stacked row has two columns
={A1:B2; C1:D2}
Count columns in every segment. When combining side by side, count rows. Empty segments still need placeholders if you are forcing a rectangular array.
Mixed data types in a column
QUERY assigns one type per column from the majority data type. Values of minority data types are treated as null for query purposes, so they can appear blank in the output or drop out of comparisons.
Examples that confuse type detection:
- Numbers stored as text (
'100) mixed with real numbers - Dates mixed with plain text notes in the same column
- A header row accidentally included as data when the third argument is
0
What to do:
- Set the header argument correctly (next section).
- Convert the column to one type before querying (
VALUE,TO_TEXT,DATEVALUE, or a helper column). - Avoid leaving random text in a numeric results column.
If blank-looking formula results are involved, clean them first using the patterns in blank, null and empty QUERY conditions.
Headers argument wrong or omitted
=QUERY(data, query, [headers])
headers value | Meaning |
|---|---|
| omitted | Google Sheets guesses how many header rows exist |
0 | No header row in the range |
1 | One header row |
2+ | Multi-row headers |
Wrong guesses produce mislabelled columns, types inferred from header text, or filters that skip the first data row. Prefer an explicit value:
=QUERY(A1:C, "select * where B is not null", 1)
=QUERY(A2:C, "select * where B is not null", 0)
Col notation checklist
Use Col1, Col2, … when the data is an expression, not a simple contiguous range:
=QUERY({Sheet1!A2:C; Sheet2!A2:C}, "select Col1, sum(Col3) where Col1 is not null group by Col1", 0)
- Index from the left of the constructed array, not the sheet.
- Do not mix
AandCol1for the same virtual table. - After reordering columns inside
{}, renumber everyColreference.
Locale separators in array literals
In many regions, formula arguments use commas. In others (comma-as-decimal locales), horizontal array items use a backslash and vertical stacks still use a semicolon—but confirm against your locale:
// Dot-decimal locales (US, AU, UK, …)
=QUERY({A2:A, D2:D}, "select Col1, Col2", 0)
// Comma-decimal locales (many EU locales)
=QUERY({A2:A \ D2:D}, "select Col1, Col2", 0)
If a formula pasted from a tutorial fails immediately inside {...}, change the separator before debugging the query string. The same locale rules apply when building multi-range data.
Quick diagnostic order
- Read the exact error text.
- Confirm the data range (or
{...}array) is rectangular and the right height. - Set
headersexplicitly to0or1. - Use letters for simple ranges and
ColNfor arrays. - Quote text literals with single quotes; concatenate cell values carefully.
- Check mixed types and blank-looking formula results.
- Adjust locale separators if the array literal itself will not parse.
Related QUERY guides
| Topic | Guide |
|---|---|
| Blank / null filters | Blank, null and empty conditions |
| SELECT and WHERE basics | QUERY SELECT and WHERE |
| Multiple criteria | Multiple criteria in QUERY |
| Cell value in WHERE | WHERE referencing a cell |
| Multi-range data | Multiple ranges in QUERY |
| Stacking ranges | Concatenate ranges for QUERY |
Most QUERY failures are structural (quotes, headers, array shape, column names) rather than logic errors in the filter. Fix the structure first, then refine the where clause.