What it does
SUBTOTAL calculates summaries that can ignore filtered rows.
Syntax or pattern
=SUBTOTAL(function_num, ref1, [ref2], ...)5 practical examples
Sum visible rows
Sum only rows visible after filtering.
=SUBTOTAL(109,Sales[Amount])109 sums visible values.
Count visible rows
Count visible numeric values.
=SUBTOTAL(102,B2:B100)Useful with filters.
Average visible rows
Average filtered results.
=SUBTOTAL(101,Sales[Amount])Changes as filters change.
Find max visible value
Return maximum among visible rows.
=SUBTOTAL(104,B2:B100)Good for filtered reports.
Use in a table total row
Add a dynamic total at the bottom of a table.
=SUBTOTAL(109,[Amount])Excel Tables often use this pattern.
Common mistakes to avoid
- Selecting ranges with different sizes.
- Using text values where numbers are required.
- Forgetting how blanks and hidden rows are treated.
Related Excel examples
FAQ
Can this formula use Excel Tables?
Yes. Structured references often make summary formulas easier to read.
Here are some ideas for you
Optional resources that may help if you are learning formulas, building reports, or working in spreadsheets often.
- Excel formula booksSee ideas
Practice formulas with structured examples you can keep beside your desk.
- Excel shortcut guidesSee ideas
Build speed with keyboard shortcuts for selection, formatting and navigation.
- Numeric keypadsSee ideas
Helpful if you enter many numbers on a laptop or compact keyboard.
- External monitorsSee ideas
Useful for viewing large worksheets, formulas and reference tables side by side.
- Desk notebooksSee ideas
Sketch formula logic, report ideas and table structures before building.
- Laptop standsSee ideas
Make long spreadsheet sessions more comfortable and ergonomic.
Some links in this section may be affiliate links. Choose only what is useful for your own work.