Why a spreadsheet filter does not always change the total
Understand SUM versus SUBTOTAL, filtered and manually hidden rows, and the difference between a visible spreadsheet subset and a defined financial population.
In brief
Filtering changes which rows are displayed, but a formula may still reference the entire range. In Excel, SUM and SUBTOTAL have different inclusion behavior, and SUBTOTAL’s function number determines how manually hidden rows are treated. Choose the calculation from the intended population, then label whether the result follows the current view or a fixed analytical rule.
Key takeaways
- Visible rows and formula inputs can describe different populations.
- SUBTOTAL excludes filtered-out rows, while 9 and 109 differ on manually hidden rows.
- A presentation filter is not a substitute for a documented eligibility rule.
- A correct visible subtotal can still be the wrong input for the financial decision.
A finance analyst filters a sales sheet to one region. The visible rows now describe that region, but the headline total remains unchanged. The formula may be working exactly as written while the reader interprets it as a different calculation.
Check the population the formula includes. Filtering is a display operation, and whether a total follows that display depends on the function and its arguments.
Use a small range to expose the difference
Consider four fictional rows, with region labels in column A and amounts in column B. Row two is East with 100, row three is West with 200, row four is East with 300 and row five is West with 400.
The formula =SUM(B2:B5) totals 1,000. If the sheet is filtered to East, the visible amounts are 100 and 300, but the SUM formula still references all four values.
That may be intentional if the number is labelled all-region total. It becomes misleading when a nearby heading implies that it is the East subtotal.
Understand what SUBTOTAL changes
Microsoft's SUBTOTAL documentation specifies that filtered-out rows are excluded. Function number 9 performs a sum that includes manually hidden rows, while 109 performs a sum that excludes them.
With the East filter applied, both =SUBTOTAL(9,B2:B5) and =SUBTOTAL(109,B2:B5) return 400 in this example. The West rows are filtered out of both calculations.
Now manually hide row four, which contains the East amount of 300, while keeping the East filter. SUBTOTAL with 9 still returns 400; SUBTOTAL with 109 returns 100. SUM over the original range remains 1,000.
| Formula | East filter only | East filter plus manually hidden row four |
|---|---|---|
| SUM(B2:B5) | 1,000 | 1,000 |
| SUBTOTAL(9,B2:B5) | 400 | 400 |
| SUBTOTAL(109,B2:B5) | 400 | 100 |
The arithmetic and documented function behavior explain the difference. It is not evidence that Excel has lost a row or that the underlying sales changed.
Choose the meaning before choosing the function
A current-view subtotal should follow the intended visibility rule. A fixed regional metric should instead implement the region criterion explicitly in an appropriate formula or reporting transformation, so unrelated presentation changes do not redefine it.
For example, manually hiding a disputed transaction to make a review easier should not necessarily remove it from the official regional total. Its analytical treatment needs a documented status and inclusion rule.
Microsoft's worksheet guidance notes that filtering leaves the underlying rows in the sheet. Treat the filter as a view of the data, not proof that excluded rows have been removed from every calculation.
Check the range as well as the function
A visibility-aware function can still reference the wrong rows. Inspect the start and end cells, new data appended outside the range and any summary rows included in the reference.
Microsoft documents special handling of nested SUBTOTAL formulas to avoid double counting. That does not mean every manually inserted summary, hard-coded subtotal or other formula will be recognized as a nested subtotal.
Keep raw records and presentation summaries clearly organized. A total that reconciles today can become incomplete when new rows arrive if the range does not expand as intended.
Do not transfer row behavior to hidden columns
The documented SUBTOTAL behavior is designed for vertical ranges. Hiding a column in a horizontal range does not create the same exclusion behavior as hiding a row in the example.
If a model places periods across columns, inspect its formulas directly rather than assuming that a hidden month disappears from an annual calculation. A display choice should not silently define the investment horizon.
This matters when a subtotal feeds net present value or another financial measure. The relevant cash-flow population and dates should remain explicit regardless of which columns are currently visible.
Review a saved output with its filter state
A screenshot or PDF can show a filtered table without showing how the total was calculated. Label whether the headline is all records, the current visible view or a fixed criteria-based subset.
Record important filter and exclusion conditions in the assumption register. The guide to building that register helps preserve the analytical rule beyond one workbook session.
When a reviewer receives the workbook, provide a way to reconcile the headline to the relevant records. A filter icon alone is not a sufficient explanation of the population.
Test the boundary with a known example
Use a small copy or controlled review range to check an included row, a filtered row and a manually hidden row. Confirm the expected result before applying the formula to a large dataset.
Also check missing values, text-formatted amounts and error cells where they exist. The visibility rule does not solve data-quality problems elsewhere in the range.
The guide to separating inputs from formulas supports that inspection. Use the executive editor and the financial decision hub to explain the resulting metric.
A reliable total has an inclusion rule that matches the decision and remains understandable when the spreadsheet's appearance changes.
Sources & further reading
- Microsoft Support: SUBTOTAL function
Function numbers 9 and 109, exclusion of filtered-out rows, manual-row hiding behavior and vertical-range limitation.
- Microsoft Support: Ways to count values in a worksheet
Distinguishes SUM and SUBTOTAL in handling hidden rows and explains that filtered rows remain in the worksheet.
Related topics
- financial-models
Research the question.
Build the case.
Use Research Reports to understand the opportunity. Use Executive Editor to develop the recommendation, examine the assumptions and prepare a decision paper.
Research Reports
Explore markets, competitors, customers, brand perception or a product idea. Each one is a complete Standard report.
AI-assisted desk research · One-time report purchaseExplore Research ReportsExecutive Editor
Write your case, connect evidence and calculations, review proposed changes and publish a saved version when you are ready.
Use your TDP account · No report purchase requiredExplore Executive Editor