SUBTOTAL 9 is the function number that tells Excel's SUBTOTAL function to sum a range while ignoring rows that have been hidden by a filter. In practice, =SUBTOTAL(9,A2:A100) adds up the visible values in A2:A100 and skips any row that is filtered out. It is a standard, documented Excel function argument, not slang or a nonstandard term. The "9" is simply the code for the SUM function inside SUBTOTAL, and it is the most common of the 22 function numbers the argument accepts.

Background: Where the 9 Comes From

Excel's SUBTOTAL function was introduced to solve a specific problem: a normal SUM formula keeps adding hidden rows, so a filtered list still shows the grand total of everything, not the total of what you can see. SUBTOTAL takes two arguments: a function number and the range. The function number is a code that maps to one of eleven calculation types, and each type has two versions.

  • 1 through 11 include manually hidden rows in the calculation.
  • 101 through 111 ignore manually hidden rows as well as filtered rows.

The mapping is fixed: 1 and 101 mean AVERAGE, 2 and 102 mean COUNT, 3 and 103 mean COUNTA, 4 and 104 mean MAX, 5 and 105 mean MIN, 6 and 106 mean PRODUCT, 7 and 107 mean STDEV, 8 and 108 mean STDEVP, 9 and 109 mean SUM, 10 and 110 mean VAR, and 11 and 111 mean VARP. So "SUBTOTAL 9" is shorthand for "use SUBTOTAL with the SUM function number." The term is standard Excel terminology and appears in Microsoft's own documentation.

How SUBTOTAL 9 Works in Practice

Suppose you have a sales table in A1:C50 with a header row, and you filter column B to show only one region. A formula of =SUBTOTAL(9,C2:C50) placed below the table returns the sum of column C for the visible rows only. If you clear the filter, the same formula returns the sum of all rows. That behaviour is the whole point: the formula responds to what is on screen.

The 9 version ignores filtered rows but still counts rows you hid manually by right-clicking and choosing Hide. The 109 version ignores both. That distinction matters when you hide rows for presentation reasons rather than filtering.

SUBTOTAL also automatically ignores other SUBTOTAL formulas inside the range, which prevents double counting when you have subtotals in a table and then add a grand total at the bottom. Nested SUBTOTALs are skipped, so the grand total stays correct.

How to Choose Between 9 and 109

Use 9 when you want the total to change only with filters, and use 109 when you also want manually hidden rows excluded. A few practical guidelines:

  • If you filter data and want the visible total, 9 is the usual choice and matches what most templates expect.
  • If you hide rows by hand to exclude them from a report, 109 gives the total you probably intend.
  • If you are unsure, test both: filter one row and hide another, then compare the two results.
  • Remember that neither version ignores rows excluded by a formula that returns an empty string; SUBTOTAL counts those as values in some functions, so check your data.

Common Problems and Misconceptions

The most common mistake is assuming SUBTOTAL 9 ignores all hidden rows. It does not; it ignores filtered rows only. Another frequent issue is placing the SUBTOTAL formula inside the range it references, which creates a circular reference. Keep the formula outside the summed range, for example in row 51 when the data runs from row 2 to row 50.

A related misconception is that SUBTOTAL replaces SUM everywhere. It does not: SUBTOTAL is designed for lists and tables, and it does not work with 3D references across multiple sheets. It also cannot be used with array constants in the same way SUM can. For a plain total of a fixed range with no filtering, SUM is simpler and faster.

One more trap: if you copy a SUBTOTAL formula down a column, the function number stays the same, but the range may shift. Use absolute references such as $C$2:$C$50 if the range should stay fixed.

SUBTOTAL 9 vs SUM and AGGREGATE

SUM adds every cell in the range regardless of filters or hidden rows. SUBTOTAL 9 adds only visible filtered rows. AGGREGATE is a newer function that offers more options, including ignoring errors, and uses function numbers 1 through 19. For simple filtered totals, SUBTOTAL 9 is the standard and most widely supported choice. For totals that must also skip error values, AGGREGATE with the appropriate options is the better tool.

Frequently Asked Questions

Is SUBTOTAL 9 the same as SUM?

No. Both add numbers, but SUBTOTAL 9 ignores rows hidden by a filter, while SUM includes them. If no rows are filtered, the two return the same result.

Why does SUBTOTAL 9 still count manually hidden rows?

Because the 9 version only excludes filtered rows. To exclude manually hidden rows as well, use 109 instead.

Can I use SUBTOTAL 9 across multiple worksheets?

No. SUBTOTAL does not support 3D references such as Sheet1:Sheet3!A1:A10. Use SUM for that, or place a SUBTOTAL on each sheet and total those results.

What does the 9 stand for?

It is the function number that maps to SUM inside the SUBTOTAL function. The full list runs from 1 (AVERAGE) to 11 (VARP), with 101 to 111 as the versions that also ignore manually hidden rows.

Does SUBTOTAL 9 work in Excel tables?

Yes. When you add a total row to an Excel table, Excel inserts a SUBTOTAL formula automatically, and it updates as you filter the table.

Quick Reference

To use SUBTOTAL 9, type =SUBTOTAL(9,range) where range is the column of numbers you want to total. Place the formula outside the data range, use absolute references if you copy it, and choose 109 instead of 9 if manually hidden rows should also be excluded. The function number is standard Excel syntax, documented by Microsoft, and safe to use in shared workbooks.