Premium Google Sheets drill · QUERY
QUERY the highest units
Practice Google Sheets QUERY order by to sort products by units descending while the header stays on top.
A1:B5 is a product list with units. order by sorts the data rows and leaves the header in place when you pass a header count.
In D1, select both columns and order by units descending.
Dataset
Starter sheet. Cells marked formula are where the formula goes.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Product | Units | Formula goes in D1. formula | ||
| 2 | Pen | 10 | |||
| 3 | Book | 25 | |||
| 4 | Clip | 8 | |||
| 5 | Desk | 40 |
Hint
Descending is the word desc after the column: order by B desc.
Explanation
order by B desc lists Desk, Book, Pen, then Clip. The header row is not sorted with the numbers, so Product and Units stay in D1:E1.
The interactive sheet and a worked solution are part of Formula Drills Premium. The instructions and starter data on this page are the full problem.