FxFormula Drills

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.

Starter sheet for this exercise
RowABCDE
1ProductUnitsFormula goes in D1. formula
2Pen10
3Book25
4Clip8
5Desk40

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.

Solve this drill

Practice this formula

Loading the practice grid…

Google Sheets is a trademark of Google LLC. Formula Drills is not affiliated with Google. Excel drills on this site are a separate track.