deepcalc
DocsPIVOTBY

PIVOTBY

Groups rows and columns and aggregates the 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

=PIVOTBY(A1:A4, B1:B4, C1:C4, SUM)
ABC
1 northQ11
2 southQ12
3 northQ23
4 southQ24
Result

Syntax

PIVOTBY(row_fields, col_fields, values, function, [field_headers], [row_total_depth], [row_sort_order], [col_total_depth], [col_sort_order], [filter_array], [relative_to])
row_fields
range required
col_fields
range required
values
range required
function
any required
field_headers
number optional
row_total_depth
number optional
row_sort_order
number optional
col_total_depth
number optional
col_sort_order
number optional
filter_array
range optional
relative_to
number optional

Errors

#VALUE!
=PIVOTBY(1, 2, A1:A3, 4)