Excel SUBTOTAL function📊 Total of visible rows
The SUBTOTAL function: Total of visible rows. A total that follows the filter. This page shows the syntax, a worked example with its result and how the formula reads.
What does SUBTOTAL do?
Total of visible rows. A total that follows the filter
SUBTOTAL syntax
=SUBTOTAL(function_num, ref1, [ref2], ...)
Arguments in square brackets [ ] are optional · argument names follow Microsoft's documentation
SUBTOTAL example with the result
=********
👑 Ready-to-use example formula for VIP supporters only · Become VIP
Formula in cell B6 Yellow cells = result
| A | B | |
|---|---|---|
| 1 | Item | Sales |
| 2 | Coffee | 120 |
| 3 | Thai tea | 80 |
| 4 | Snack | 45 |
| 5 | Water | 60 |
| 6 | Visible total | 305 |
How it reads: 9 = sum (1 = average, 2 = count, 4 = max) · when a filter is on, only visible rows count
Frequently asked questions about SUBTOTAL
What does SUBTOTAL do?
Total of visible rows. A total that follows the filter
What does the SUBTOTAL example return?
The example formula in cell B6 gives 305.
Which Excel versions have SUBTOTAL?
It has been in Excel for many versions and works in the versions in common use today, including Excel for Microsoft 365.
🕸️ More stats and ranking formulas and related ones
Source: support.microsoft.com
Checked 17 November 2026 · by Black Sheep Barn · example results are calculated by the app's example engine, for learning