To use the SUBTOTAL formula with function number 109 in Excel, type =SUBTOTAL(109, range) into a cell, replacing range with the cells you want to sum. The 109 tells Excel to add up only the visible rows in that range, ignoring rows hidden by a filter and ignoring any other SUBTOTAL formulas inside the range. This is the go-to formula for totals that need to update automatically when you filter a table.

What You'll Need

  • Excel 2010 or later (the 109 argument works in all modern versions, including Microsoft 365, Excel 2019, 2021, and 2024).
  • A worksheet with data arranged in columns, ideally with a header row.
  • Basic familiarity with selecting cell ranges and typing formulas.

Step-by-Step

  1. Set up your data. Make sure your numbers are in a single column (or row) with a clear header. For example, put sales amounts in column B starting at B2, with “Sales” in B1.
  2. Click the cell where you want the total. This is usually just below the data or in a summary area.
  3. Type the formula. Enter =SUBTOTAL(109, B2:B100) and press Enter. Adjust the range to match your actual data. The 109 is the function number for SUM that ignores hidden rows.
  4. Verify the result. The cell should show the sum of all visible numbers in the range. If you have no hidden rows yet, it will equal the regular SUM of that range.
  5. Apply a filter to test. Select your header row, go to the Data tab, and click Filter. Use the dropdown arrows to hide some rows. The SUBTOTAL cell should recalculate to show only the visible rows.
  6. Use it in multiple places. You can copy the formula to other columns or rows. Just ensure the range references adjust correctly (relative references by default).
  7. Combine with other SUBTOTAL functions if needed. For example, =SUBTOTAL(109, B2:B100) for sum and =SUBTOTAL(103, A2:A100) for count of visible items. The 100-series numbers all ignore hidden rows.

Common Mistakes

  • Using 9 instead of 109. Function number 9 also sums, but it includes manually hidden rows (rows you right-click and hide). Only 109 ignores both filtered and manually hidden rows. If you want to exclude only filtered rows, use 9; if you want to exclude all hidden rows, use 109.
  • Including the SUBTOTAL cell in its own range. This creates a circular reference. Keep the range limited to the data rows, not the total row.
  • Forgetting that SUBTOTAL ignores other SUBTOTALs. If you have nested SUBTOTALs, the outer one will ignore the inner ones, which is usually desired but can be surprising.
  • Assuming 109 works with all functions. The 100-series numbers exist for SUM (109), AVERAGE (101), COUNT (102), COUNTA (103), MAX (104), MIN (105), PRODUCT (106), STDEV (107), STDEVP (108), VAR (110), and VARP (111). Using 109 only makes sense for SUM.
  • Typing the range incorrectly. Use a colon for a continuous range (B2:B100) or a comma for multiple ranges (B2:B10, B15:B20). Do not include spaces.

Tips

  • Use Excel Tables. If you convert your data to a table (Ctrl+T), SUBTOTAL formulas in the Total Row automatically use the 109 version when you filter, making it seamless.
  • Combine with conditional formatting. You can highlight the SUBTOTAL cell to make it stand out.
  • Use named ranges. Define a name for your data range (Formulas > Define Name) and use it in the formula, e.g., =SUBTOTAL(109, SalesData).
  • Remember that 109 ignores rows hidden by filters and manually hidden rows. If you need to include manually hidden rows but exclude filtered ones, use 9 instead.
  • Test with a small dataset. Before applying to large data, try on a few rows to confirm behavior.

Troubleshooting

  • The total doesn’t change when I filter. Check that you used 109, not 9. Also ensure the filter is applied to the same range or table that the SUBTOTAL references. If the filter is on a different column, the SUBTOTAL still works as long as the rows are hidden.
  • I get a #VALUE! error. This usually means the range contains text or errors. SUBTOTAL ignores text in the sum, but if the range includes error values, it will return an error. Use AGGREGATE or clean the data.
  • The formula returns 0. Check that the range actually contains numbers. If the cells are formatted as text, SUBTOTAL will ignore them. Convert to numbers.
  • Circular reference warning. The SUBTOTAL formula is likely including its own cell. Adjust the range to exclude the total row.
  • Manual hidden rows are still included. You might have used 9 instead of 109. Switch to 109.

Frequently Asked Questions

What does the 109 in SUBTOTAL mean?

109 is the function number for SUM in SUBTOTAL that ignores rows hidden by filters and rows you hide manually. It also ignores other SUBTOTAL formulas in the range.

Can I use SUBTOTAL with other functions like AVERAGE?

Yes. Use 101 for AVERAGE, 102 for COUNT, 103 for COUNTA, 104 for MAX, 105 for MIN, and so on. The 100-series all ignore hidden rows.

Does SUBTOTAL work with filtered data in Excel Tables?

Yes. When you add a Total Row to a table, Excel automatically inserts SUBTOTAL formulas with the 109 function number for sum, so it updates with filters.

Why does my SUBTOTAL give a different result than SUM?

Because SUBTOTAL with 109 excludes hidden rows and nested SUBTOTALs, while SUM includes everything. If you have hidden rows, the results will differ.

Can I use SUBTOTAL on multiple columns at once?

No, SUBTOTAL works on a single range. You can copy the formula across columns, but each formula references its own range.

Is SUBTOTAL available in Excel for Mac?

Yes, SUBTOTAL works the same in Excel for Mac, including the 109 function number.