Syntax
=SUBTOTAL(function_num, ref1, [ref2], ...)
Arguments
| Argument | Required | Description |
|---|
function_num | Required | 1 AVERAGE, 2 COUNT, 3 COUNTA, 4 MAX, 5 MIN, 6 PRODUCT, 7 STDEV, 8 STDEVP, 9 SUM, 10 VAR, 11 VARP; add 100 to skip hidden rows |
ref1 | Required | The first range |
ref2 | Optional | More ranges |
How to use SUBTOTAL
SUBTOTAL takes 2 required arguments and 1 optional argument, and accepts more values in the same pattern. Type =SUBTOTAL( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=SUBTOTAL(9, A1:A3)Result
=SUBTOTAL(1, A1:A3)Result
=SUBTOTAL(9, A1:A3)Result