Quick answer: In QUERY(data, query, [headers]), parameter 2 is the query-language expression. If Google Sheets says it cannot parse that parameter, inspect the query string, not just the spreadsheet formula punctuation. QUERY uses the Google Visualization API Query Language, which has its own syntax.
Understand the two layers of syntax
=QUERY(A1:C10,"select A, B where C > 10",1)
The outer expression is a Google Sheets function. The text inside quotation marks is the query language. A formula separator issue can fail at the outer layer; a malformed select/where/group by clause can fail inside parameter 2.
Fix 1: Start with a minimal query
Try a basic query on a known small range:
=QUERY(A1:C10,"select A, B",1)
If this works, add one clause at a time. This isolates which part of the expression is failing. The last argument states how many header rows the data contains; giving an accurate value avoids inferred-header surprises.
Fix 2: Check column identifiers
A normal grid range such as A1:C10 commonly uses A, B, C identifiers in QUERY examples. An array-generated input can require Col1, Col2 style identifiers instead. Do not blindly replace syntax without checking the structure of your data argument.
Fix 3: Check quoting and data types
Text comparisons inside the query expression require quotes around string values, with the complete query still enclosed in the outer spreadsheet string. For example:
=QUERY(A1:C10,"select A where B = 'Active'",1)
Date conditions use query-language date literal syntax rather than the spreadsheet’s displayed date convention. When debugging those, consult the official query-language reference instead of guessing from the rendered date format.
Worked example: fix a malformed QUERY expression
Use this small, illustrative dataset in A1:C5. Column A is the customer, B is the status, and C is the numeric amount:
| A — Customer | B — Status | C — Amount |
|---|---|---|
| Acme | Active | 120 |
| Birch | Paused | 80 |
| Cedar | Active | 60 |
| Delta | Active | 40 |
This example contains a misplaced comma after A, leaving the select clause incomplete. That is a query-language syntax problem, not a missing source value:
=QUERY(A1:C5,"select A, where B = 'Active'",1)
Replace it with a complete list of selected columns:
=QUERY(A1:C5,"select A, C where B = 'Active'",1)
With the sample data, the expected result is Acme — 120, Cedar — 60, and Delta — 40, with the selected-column headers. The Paused row is excluded. This is a reasoned example based on documented syntax, not a claim that we ran the formula in a live sheet.
If the query parses but reports an unknown column, check its column identifiers rather than changing punctuation at random. If it runs but returns missing values, check source-column data types. A spreadsheet locale that uses semicolons may require changing the outer function argument separators; do not replace the comma between A and C inside the query-language string.
Fix 4: Distinguish parse errors from missing rows
Google documents that mixed data types in a QUERY input column may be interpreted according to the majority type; minority types can be treated as null. This can cause unexpectedly missing values even when the query text itself is syntactically valid. Fix data consistency if the query runs but returns incomplete results.
Sources
Editorial note: Formula snippets are instructional examples, not independently tested results.