ROWTOTAL

Information

The ROWTOTAL function returns a one-column array of aggregations of each row in the referenced array. The type of aggregation is specified by the function_code argument, and is analogous to the aggregation codes used in the native SUBTOTAL function. Currently the supported values for function_code are 1 (AVERAGE), 2 (COUNT), 3 (COUNTA), 4 (MAX), 5 (MIN), 6 (PRODUCT) and 9 (SUM).

The array argument may be an explicitly referenced range, or an array generated by an array calculation. It may be a so-called “open-ended” range (eg B:F), which is recommended for form submissions as such ranges will automatically accommodate an increasing number of rows in the sheet. However, the output of ROWTOTAL will only extend to the last populated row in the referenced range; CONTINUE functions will be populated below the last populated row in the referenced data, but they will only produce blank cells.

The header argument is optional, and if specified will replace the first cell of the output with that argument, providing an easy way to create a header. For example, =ROWTOTAL(9;B:F;”Total”) will ignore any entries in B1:F1, and populate the word “Total” in the first cell of the output.

Syntax

ROWTOTAL(function_code;array[;header])