FxFormula Drills

Premium Google Sheets drill · QUERY

QUERY a total by product

Practice Google Sheets QUERY group by to sum units for each product. The total column is labeled sum Units.

The same product appears on more than one row. group by collapses those rows, and sum adds the units in column C.

In E1, select the product and the sum of units, grouped by product. Keep one header row.

Dataset

Starter sheet. Cells marked formula are where the formula goes.

Starter sheet for this exercise
RowABCDEF
1ProductRegionUnitsFormula goes in E1. formula
2PenEast10
3BookWest25
4PenWest15
5ClipEast8

Hint

The query is select A, sum(C) group by A.

Explanation

Pen's 10 and 15 become 25. Book stays 25 and Clip stays 8. With headers, the total column is labeled sum Units.

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.