GROUPBY
Create a spilling summary by grouping records and aggregating measures.
Syntax
=GROUPBY(row_fields, values, function, [field_headers], [total_depth], [sort_order], [filter_array], [field_relationship])Worked example
Group three transactions by item and total their units. The two zero arguments suppress field headers and grand totals.
=GROUPBY({"Tea";"Soap";"Tea"},{3;2;4},SUM,0,0)Result Soap 2 / Tea 7
Microsoft documentation
Check the arguments, supported editions and behavior of this function in Microsoft’s reference.
Microsoft referenceExcel GROUPBY Function is MAGIC🪄
Practice GROUPBY
Group three transactions by item and total their units. The two zero arguments suppress field headers and grand totals.
| A | B | |
|---|---|---|
| 1 | Argument | Input |
| 2 | Row fields | Tea |
| 3 | Soap | |
| 4 | Tea | |
| 5 | Values | 3 |
| 6 | 2 | |
| 7 | 4 | |
| 8 | Field headers | 0 |
| 9 | Total depth | 0 |
Show example formula
=GROUPBY(B2:B4,B5:B7,SUM,B8,B9) Lesson quiz
Answer three questions to see your level in this lesson.
