Filter and Sort Data With QUERY
Your deals list runs hundreds of rows, and you need a live view of just the big ones — customer and amount, only where the amount tops 1,000, sorted largest first — without touching the original data.
Excel & Google Sheets
How it works
QUERY is Google Sheets only: it runs a miniature SQL statement over a range, and this one keeps columns A and D, drops every row where D is 1,000 or less, and sorts what's left by D descending. The crucial quirk is that you refer to columns by their spreadsheet letters (A, D), never by their header names. The final 1 tells QUERY the first row is headers, so the headers ride along into the output instead of being treated as data. Excel has no QUERY — the 365 equivalent chains dynamic arrays: FILTER keeps the rows where the amount beats 1,000, CHOOSE({1,2},…) stitches just the customer and amount columns side by side, and SORT(…,2,-1) orders by the second column, descending.
When to use it
Use it for live report views that update as the source changes: top deals over a threshold, unpaid invoices sorted by amount, open orders for one customer — anywhere you'd otherwise filter and sort by hand every week.
Common mistakes
Did this formula help?
Human-reviewedLast reviewed 2026-07-08