Google Sheets formula builder

Google Sheets QUERY Formula Builder

Create a QUERY formula for selecting columns, filtering rows, adding date conditions, and ordering results.

Builder inputs

Use Google Visualization query syntax for WHERE and ORDER BY clauses.

Formula is valid and ready to copy.

Google Sheets formula
=QUERY(A1:D100, "SELECT A, B, D WHERE B = 'East' AND A >= date '2026-01-01' ORDER BY A DESC", 1)
Date syntax warning
QUERY date filters must use the date 'YYYY-MM-DD' literal format inside the query string.

How this formula works

  • QUERY wraps a SQL-like query string inside a spreadsheet formula.
  • Selected columns must be written as column letters when the source range uses A1 notation.
  • Date conditions need the exact date literal syntax: date 'YYYY-MM-DD'.

Sample data

DateRegionProductAmount
2026-01-04EastWidget420
2026-01-12WestWidget310
2026-02-03EastGadget275
2026-02-15EastWidget640

Common mistakes

  • Using double quotes inside the query string without escaping them.
  • Writing dates as plain text instead of date literals.
  • Mixing column letters and header names in the same query.

Related formulas

FAQ

Are these formulas generated with AI?

No. The builder uses deterministic TypeScript functions in the browser and does not call any AI API.

Do I need to upload my spreadsheet?

No. Enter ranges and criteria manually. The site does not upload, store, or process spreadsheet files.

Can I copy the generated formula?

Yes. Each output includes a copy button so you can paste the formula into Excel or Google Sheets.