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.
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Product | Region | Units | Formula goes in E1. formula | ||
| 2 | Pen | East | 10 | |||
| 3 | Book | West | 25 | |||
| 4 | Pen | West | 15 | |||
| 5 | Clip | East | 8 |
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.