Average Visible (Filtered) Rows Only

Excel Formulas › Average

All versionsSUBTOTAL

When you filter a list, ordinary AVERAGE still includes the hidden rows. SUBTOTAL with function 101 averages only the visible cells — the number updates live as you filter.


Quick formula: average only the rows a filter leaves visible:
=SUBTOTAL(101, B2:B100)
Function code 101 = AVERAGE of visible cells; it ignores anything the filter hides.

Functions used (tap for the full reference guide):

The example

Filter the list — the average follows.

AB
1RegionVisible avg
2West= SUBTOTAL(101,…)

The formula

The formula:

=SUBTOTAL(101, B2:B100) // visible cells only

How it works

How it works:

  1. SUBTOTAL(101, range) averages only cells left visible by a filter.
  2. The 1xx codes exclude filtered and manually hidden rows; the 1–11 codes (e.g. 1) exclude filtered rows only.
  3. It recalculates instantly as you change the filter — perfect for a summary row above a table.
  4. SUBTOTAL also ignores other SUBTOTALs in the range, so nested subtotals don’t double-count.

Code cheat-sheet: 101 = AVERAGE, 109 = SUM, 102 = COUNT, 103 = COUNTA, 104 = MAX, 105 = MIN, all visible-only. The newer AGGREGATE function does the same and can also skip errors — =AGGREGATE(1, 5, range) averages visible, error-free cells.

Try it: interactive demo

Live demo

Toggle rows “visible”.

Visible average:

Variations

Sum visible

Code 109:

=SUBTOTAL(109, B2:B100)

Count visible

Code 102:

=SUBTOTAL(102, B2:B100)

Visible & error-free

AGGREGATE:

=AGGREGATE(1, 5, B2:B100)

Pitfalls & errors

101 vs 1. Use 101 to also exclude manually hidden rows; 1 excludes only filtered rows.

Put it outside the data. A SUBTOTAL inside the filtered range can hide itself when filtered.

Errors still break it. SUBTOTAL doesn’t skip error cells — use AGGREGATE(1,5,…) if the range has errors.

Practice workbook

📊
Download the free Average Visible (Filtered) Rows Only practice workbook
A visible-average sheet with the sum, count, and AGGREGATE variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I average only filtered (visible) rows in Excel?
Use =SUBTOTAL(101, range). Code 101 averages just the cells a filter leaves visible and updates as you change the filter.
What's the difference between SUBTOTAL 1 and 101?
Code 1 excludes only filter-hidden rows; code 101 also excludes rows you hide manually.
How do I average visible cells that also have errors?
Use =AGGREGATE(1, 5, range), which averages visible cells while ignoring errors.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Subtotal visible rows · Average ignore errors · Sum visible cells

Function references: SUBTOTAL