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:

MistakeFix
Missing or mismatched quotesKeep the whole query in double quotes; put string literals in single quotes: "select * where A = 'Open'"
Wrong clause spellingUse 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 queryNumeric literals often need a dot: B > 1.5 even when the sheet displays 1,5
Broken concatenation when inserting a cellClose 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:C use letters: select A, B where C is not null.
  • Array literals and noncontiguous sets such as {A:A, C:C} use Col1, 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:

  1. Set the header argument correctly (next section).
  2. Convert the column to one type before querying (VALUE, TO_TEXT, DATEVALUE, or a helper column).
  3. 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 valueMeaning
omittedGoogle Sheets guesses how many header rows exist
0No header row in the range
1One 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 A and Col1 for the same virtual table.
  • After reordering columns inside {}, renumber every Col reference.

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

  1. Read the exact error text.
  2. Confirm the data range (or {...} array) is rectangular and the right height.
  3. Set headers explicitly to 0 or 1.
  4. Use letters for simple ranges and ColN for arrays.
  5. Quote text literals with single quotes; concatenate cell values carefully.
  6. Check mixed types and blank-looking formula results.
  7. Adjust locale separators if the array literal itself will not parse.
TopicGuide
Blank / null filtersBlank, null and empty conditions
SELECT and WHERE basicsQUERY SELECT and WHERE
Multiple criteriaMultiple criteria in QUERY
Cell value in WHEREWHERE referencing a cell
Multi-range dataMultiple ranges in QUERY
Stacking rangesConcatenate 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.