Table of Contents
Use =SUBTOTAL(109,C2:C15) to add the visible numbers in a filtered Excel column. Use SUM when you want the total of the entire range regardless of which rows are visible. The two formulas answer different reporting questions.

Choose 9 or 109 based on manually hidden rows
Both codes for SUM exclude rows removed by a filter. Use 9 if you still want to include rows hidden by hand, or 109 to exclude those as well. This behavior is intended for vertical ranges. Hiding a column does not apply the same rule to a horizontal formula.
| Calculation | Include manually hidden rows | Exclude manually hidden rows |
|---|---|---|
| AVERAGE | 1 | 101 |
| COUNT | 2 | 102 |
| COUNTA | 3 | 103 |
| MAX | 4 | 104 |
| MIN | 5 | 105 |
| PRODUCT | 6 | 106 |
| STDEV | 7 | 107 |
| STDEVP | 8 | 108 |
| SUM | 9 | 109 |
| VAR | 10 | 110 |
| VARP | 11 | 111 |
Try a filtered sales report
Put the formulas below outside the filtered range. Then filter the product column and see how the results change.
=SUBTOTAL(109,C2:C15)adds the visible amounts.=SUBTOTAL(103,A2:A15)counts visible nonblank cells in column A. Use a column that is filled for each record.=SUBTOTAL(101,C2:C15)averages visible numeric amounts directly.



SUBTOTAL ignores nested SUBTOTAL formulas in its referenced range, which helps avoid double-counting. Manually entered totals or results from ordinary SUM formulas can still be included. Check the range if the answer looks too large.
See the Microsoft SUBTOTAL reference or Google Sheets’ equivalent function. For totals that should depend on a formula criterion rather than the visible filter, review the guide to conditional totals and other Excel functions.
Reader Comments 0
Sign in with email or Google to join the discussion.