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.
=QUERY(A1:D100, "SELECT A, B, D WHERE B = 'East' AND A >= date '2026-01-01' ORDER BY A DESC", 1) 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
| Date | Region | Product | Amount |
|---|---|---|---|
| 2026-01-04 | East | Widget | 420 |
| 2026-01-12 | West | Widget | 310 |
| 2026-02-03 | East | Gadget | 275 |
| 2026-02-15 | East | Widget | 640 |
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.