FormulaCamp
Completed
← All functions
Dynamic arrays

GROUPBY

Groups and aggregates with one formula, like a PivotTable. Pass the function without parentheses: SUM.

Syntax

GROUPBY(row_fields, values, function, [field_headers], [total_depth], [sort_order], [filter_array])

Example: =GROUPBY(A2:A20,C2:C20,SUM)

Available in: Microsoft 365 only

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =GROUPBY(A2:A7,C2:C7,SUM)

Example spreadsheet for GROUPBY
ABCDEFG
1RegionProductUnitsPriceResult
2EastPen1202.5East180
3WestPen802.5North60
4EastBook4512West110
5NorthBook6012Total350
6WestLamp3025
7EastLamp1525
Result in F2: East
Practice this in a lesson: GROUPBY and PIVOTBY

More in Dynamic arrays