TX Sheet Control

SUBTOTAL Function

Function

Return a subtotal of a list, such as a sum, average or count. function_num selects the calculation: 1 AVERAGE, 2 COUNT, 3 COUNTA, 4 MAX, 5 MIN, 6 PRODUCT, 7 STDEV, 8 STDEVP, 9 SUM, 10 VAR or 11 VARP; 101 to 111 select the same calculations. ref1, ref2 and further references are the ranges to calculate. Cells that hold a SUBTOTAL formula themselves are skipped, so subtotals are not counted twice. Any other function_num returns #VALUE!.

Syntax

SUBTOTAL(function_num, ref1, ref2)

Category: Math. Minimum arguments: 2. Maximum arguments: 255.

Available for supported offline calculation.

Examples

=SUBTOTAL(9,A1:A5)

The formula adds the values of A1:A5.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

See Also