GROUPBY
Groups rows by a field and aggregates values: excel's argument list; `function` is SUM, COUNT, AVERAGE, MAX, MIN or PRODUCT, written as in excel (SUM), as text or as a selector; a LAMBDA is refused.
- Excel: Differs in detail
- Google Sheets: No equivalent
- Returns: Array
Examples
=GROUPBY(R2:R4, S2:S4, SUM) | R | S | |
|---|---|---|
| 2 | north | 100 |
| 3 | south | 200 |
| 4 | north | 300 |
Result north
=GROUPBY(R2:R4, S2:S4, 3) Result, over the same cells north
Syntax
GROUPBY(row_fields, values, function, [field_headers], [total_depth], [sort_order], [filter_array], [field_relationship]) row_fields- range required
values- range required
function- any required
field_headers- number optional
total_depth- number optional
sort_order- number optional
filter_array- range optional
field_relationship- number optional
Errors
#VALUE!=GROUPBY(1, A1:A3, 3)
Related
DAVERAGEAverage of database values matching criteria. DCOUNTCounts numeric database values matching criteria. DCOUNTACounts non-empty database values matching criteria. DGETThe single database value matching criteria. DMAXLargest database value matching criteria. DMINSmallest database value matching criteria.