How to Fix the 'Empty Output' Query Error in Google Sheets

beginner๐Ÿ“— Google Sheets2026-06-16| Google Sheets (All Browsers)

Error Message

Error: Query completed with an empty output
#google-sheets#query-function#data-types#spreadsheets

The Quick Fix (TL;DR)

Nothing breaks a dashboard faster than a sea of error messages. This specific error means your QUERY is syntactically correct, but your WHERE clause found zero matching rows. To keep your spreadsheet looking clean, wrap your formula in an IFERROR function to display a custom message instead of a broken cell:

=IFERROR(QUERY(A:C, "SELECT A, B WHERE C = 'Paid'", 1), "No matching records")

If you know for a fact that the data exists but the error persists, you are likely dealing with a data type mismatch, improper date formatting, or hidden spaces.

Common Causes and How to Fix Them

1. The Data Type Mismatch (The 51% Rule)

Google Sheets' QUERY function relies on the Google Visualization API. This API is incredibly picky. It scans the first 100 rows of a column to guess the data type (Number, String, or Date). If 90 of those rows are numbers and 10 are text, the QUERY function will often treat those 10 text rows as null values. It's a silent data killer.

The Solution: Force the entire range into a text format using ARRAYFORMULA and TO_TEXT before running the query. This levels the playing field.

=QUERY(ARRAYFORMULA(TO_TEXT(A:C)), "SELECT Col1, Col2 WHERE Col3 = 'Active'", 1)

Pro tip: When you wrap a range in ARRAYFORMULA, you must switch from column letters (A, B) to index numbers (Col1, Col2).

2. The Date Format Hurdle

Standard date formats like "12/31/2023" work in cells, but they fail inside a query string. The QUERY function demands the ISO format (yyyy-mm-dd) preceded by the date keyword. If you reference a cell like E1 that contains a date, you can't just point to it; you have to format it.

Why this fails: =QUERY(A:C, "SELECT A WHERE B > '01/01/2024'")

The proper syntax: If you are typing the date directly into the formula: =QUERY(A:C, "SELECT A WHERE B > date '2024-01-01'", 1)

If you are pulling the date from cell E1: =QUERY(A:C, "SELECT A WHERE B > date '"&TEXT(E1, "yyyy-mm-dd")&"'", 1)

3. Case Sensitivity Struggles

Computers are literal. To a Google Sheets query, "Apple" and "apple" are completely different entities. If your data uses mixed casing, a standard WHERE clause will likely miss half of your entries, resulting in an empty output.

The Solution: Use the lower() function to convert everything to lowercase during the comparison. This ensures your search is case-insensitive.

=QUERY(A:C, "SELECT A, B WHERE lower(C) = 'shipped'", 1)

4. Hidden Spaces (The Ghost in the Machine)

Sometimes your data looks perfect, but a cell actually contains "Paid " instead of "Paid". That single trailing space is enough to trigger the empty output error. This often happens with data exported from accounting software or CRMs.

The Solution: Use the contains operator instead of the equals sign (=). It is much more forgiving with whitespace.

=QUERY(A:C, "SELECT A, B WHERE C contains 'Paid'", 1)

5. Miscounting Header Rows

The third argument in your QUERY function tells Google how many rows are headers. If you leave this blank, Sheets takes a guess. If it guesses incorrectly, it might accidentally include your only row of actual data as part of the header, leaving nothing left to display in the results.

The Solution: Don't let the software guess. Explicitly set this to 1 (or 0 if you have no headers).

=QUERY(A:E, "SELECT * WHERE A IS NOT NULL", 1)

How to Verify the Fix

Follow these steps to ensure your data returns correctly:

  • Check the hover-over: Hover your mouse over the cell with the error. If the red triangle disappears, your syntax is fixed.
  • Broaden the net: Temporarily remove your WHERE clause. If data appears, the problem lies in your filter criteria, not the data range itself.
  • Test data types: Use =TYPE(A2) on your source data. If you get a mix of 1 (number) and 2 (text) in the same column, apply the TO_TEXT fix mentioned in step one.

Quick Troubleshooting Reference

  If your problem is...
  The likely culprit is...
  Apply this fix:




  Zero results found
  Restrictive filters
  Wrap in `IFERROR()`


  Missing specific rows
  Mixed data types
  Use `ARRAYFORMULA(TO_TEXT())`


  Date filters failing
  Invalid date string
  Use `date 'yyyy-mm-dd'`


  Text match failing
  Capitalization or spaces
  Use `lower()` or `contains`

Related Error Notes