Syntax
| Parameter | Description |
|---|---|
| function_num | Parameter of the SUBTOTAL function. |
| ref1 | Parameter of the SUBTOTAL function. |
| ... | Parameter of the SUBTOTAL function. |
Examples
Sum visible rows
=SUBTOTAL(9, A1:A100)
Count visible rows
=SUBTOTAL(102, B2:B500)
Average filtered data
=SUBTOTAL(1, C2:C50)
Common Errors
Invalid function number. The function_num must be 1-11 or 101-111. Other numbers return #VALUE!.
Tips
1=AVERAGE, 2=COUNT, 3=COUNTA, 4=MAX, 5=MIN, 9=SUM, 11=VAR. Add 100 to also ignore manually hidden rows (101, 109, etc.).
In a filtered table, =SUM shows the total of ALL rows. =SUBTOTAL(9,...) shows only the visible total. Always use SUBTOTAL with filters.
SUBTOTAL ignores other SUBTOTAL cells in its range. This prevents double-counting when you have subtotals and a grand total.
Try SUBTOTAL in Viztab
Import your data and use SUBTOTAL with 370+ other formulas. No signup required.
Open Viztab