Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Excel SUBTOTAL vs. SUM: How to Total Only Visible Rows

Use SUBTOTAL with 109 to sum visible rows, 103 to count nonblank entries, and 101 to average visible numbers in a filtered table.

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.

SUM for Newbies Only: Excel Experts Use This Function Instead! Picture 1

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.

CalculationInclude manually hidden rowsExclude manually hidden rows
AVERAGE1101
COUNT2102
COUNTA3103
MAX4104
MIN5105
PRODUCT6106
STDEV7107
STDEVP8108
SUM9109
VAR10110
VARP11111

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.

SUM for Newbies Only: Excel Experts Use This Function Instead! Picture 2

SUM for Newbies Only: Excel Experts Use This Function Instead! Picture 3

SUM for Newbies Only: Excel Experts Use This Function Instead! Picture 4

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.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.