deepcalc
DocsGROUPBY

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)
RS
2 north100
3 south200
4 north300
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)