FxFormula Drills

Premium Google Sheets drill · QUERY

QUERY the top two products

Practice Google Sheets QUERY limit after order by so only the two highest unit counts are returned.

limit cuts the result after sorting. The header row is not one of the limited data rows.

In D1, select both columns, order by units descending, and keep only two products.

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

Put limit 2 at the end of the query, after order by B desc.

Explanation

Descending order puts Desk and Book first. limit 2 drops Pen and Clip, and the header remains in the first result row.

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.