Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel SUBTOTAL Averages: Average Visible Rows

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To average a filtered list in Excel, use =SUBTOTAL(101, range) in place of plain AVERAGE. The function number 101 tells Excel to average only the rows that are visible right now, so when you filter or hide rows the result recalculates and leaves hidden rows out. Use 1 instead of 101 if you want manual hides respected but filtered-out rows ignored — the difference matters, and it is explained below. Nothing needs installing: SUBTOTAL has been in Excel for decades and works in every desktop version, Excel for the web and mobile, and Google Sheets.

What You'll Need

  • A table or range with a numeric column you want to average — for example an order list with a Sales column, or a survey sheet with a Score column.
  • Column headers in the first row. SUBTOTAL's usefulness depends on knowing what each column holds, and the header row is also what filter dropdowns attach to.
  • AutoFilter switched on (Data tab, or Ctrl+Shift+L on Windows / Command+Shift+L on Mac) if you plan to filter. Without a filter you can still hide rows manually, but read the difference between 1 and 101 first.
  • A cell outside the range being averaged, ideally directly below the column. If the total sits inside the range, Excel may flag a circular reference.

Step-by-Step

  1. Set up your data as one clean block. Put headers in row 1 and data below, with no blank rows or columns inside the block. A blank row breaks automatic range detection and can leave part of your data out of the average.
  2. Turn on AutoFilter. Select any cell inside the data and press Ctrl+Shift+L (Windows) or Command+Shift+L (Mac), or use Data > Filter. Dropdown arrows appear in the header row. Menu labels can differ slightly by version and region, so if Data > Filter is not where you expect, look in the ribbon's Data tab for the funnel icon.
  3. Click the cell where the average should appear — usually one row below the last data row, in the same column.
  4. Type the formula. In the formula bar enter =SUBTOTAL(101, D2:D500), replacing D2:D500 with the actual numeric range. Do not include the header cell. Press Enter. You should see a single average figure.
  5. Understand the function number you chose. 101 means "AVERAGE, ignore filtered-out rows and manually hidden rows." 1 means "AVERAGE, ignore filtered-out rows only" — manually hidden rows are still included. Pick 101 unless you deliberately hide rows and want them counted.
  6. Test it. Apply a filter on another column, for example Region = North. The average should change to reflect only visible rows. Then clear the filter with Data > Clear (or the filter dropdown's Clear Filter option) and confirm the number returns to the full-list average.
  7. Compare against AVERAGE to sanity-check. Temporarily put =AVERAGE(D2:D500) in a spare cell. With no filters applied, both numbers should match. If they differ, your SUBTOTAL range does not cover the same rows as your data, or a hidden row is being handled differently.
  8. Add a filtered row count if useful. =SUBTOTAL(102, D2:D500) returns how many numeric cells are visible, and =SUBTOTAL(103, D2:D500) counts visible non-blank rows. Displaying the count next to the average makes it obvious what the average is based on.
  9. Copy the formula safely. If you want averages for several columns, select the cell and drag the fill handle across. Because SUBTOTAL adjusts relative references, the range shifts to each column. Check the first and last result to confirm.
  10. Use SUBTOTAL inside structured table references if you have a real Excel Table. In a table, =SUBTOTAL(101, Table1[Sales]) is more readable and extends automatically as rows are added.

Common Mistakes

  • Using 1 when you meant 101. This is the single most common error. If you hide a row manually to exclude an outlier, function 1 still includes it and the average looks wrong. Function 101 excludes both filtered and manually hidden rows.
  • Putting the SUBTOTAL cell inside the averaged range. Excel then averages the average, or reports a circular reference. Keep the result cell outside the range.
  • Including the header. Text is ignored by AVERAGE, so a header usually does no harm — but if the header contains a number, such as a year, it will be averaged in. Always start the range at the first data row.
  • Nesting SUBTOTAL formulas. Any SUBTOTAL inside the range is skipped by an outer SUBTOTAL. That is deliberate protection against double counting, but it surprises people who copy formulas down a column and then average that column.
  • Expecting SUBTOTAL to ignore error values. It does not. A single #DIV/0! or #N/A in the range breaks the result. Use AGGREGATE with function numbers 101 and an options argument instead if you need to skip errors.
  • Assuming it works with AVERAGEIF logic. SUBTOTAL takes no criteria argument. To average what a filter shows, filter; to average by condition, use AVERAGEIFS.

Tips

  • Type the formula number rather than scrolling the function list — 101, 102, 103 for average, count and counta is easy to remember once you know the leading 1 means "ignore hidden."
  • Use 109 to SUM only visible rows, and 104/105 for MAX and MIN on visible rows only. The pattern holds across all the function numbers.
  • If you need to exclude only certain rows, an alternative is to delete them or move them to another area, since 101 respects manual hiding but a column filter is usually clearer and reversible.
  • Format the result cell as a number with fixed decimals so a tiny change in the filtered average is easy to spot.
  • In a PivotTable you do not need SUBTOTAL at all — use Average as the value field summary instead.

Troubleshooting

The number does not change when you filter. Check that the formula number starts with 1 (101, not 1... actually 1 does respond to filters). If you typed 101 and it still ignores the filter, confirm the filter really applied — look for the funnel icon and row numbers that skip. A filter applied to a different column than expected still affects the whole row, so that is rarely the issue. Also confirm you are not looking at a stale cell: press F9 to force a recalculation.

The average is slightly off. Suspect a range that starts or ends one row early or late. Click the formula, and Excel highlights the referenced range in colour — compare the highlight edges with your data.

You get #DIV/0!. Every visible row in the range is blank or text. Check the column reference and whether a filter has hidden all numeric rows.

The average ignores a row you can see. The cell may contain a text number (left-aligned with a green triangle in the corner). Convert it with Text to Columns or multiply by 1 in a helper column.

You get a circular reference warning. Move the formula out of the range it references.

Frequently Asked Questions

Does SUBTOTAL average hidden rows?

With function number 101, no — both filtered-out and manually hidden rows are excluded. With function number 1, filtered rows are excluded but manually hidden rows are included.

What is the difference between AVERAGE and SUBTOTAL 101?

AVERAGE always uses every cell in the range, hidden or not. SUBTOTAL 101 recalculates each time the visible rows change.

Can I average by criteria without filtering?

Use AVERAGEIF or AVERAGEIFS. SUBTOTAL has no criteria argument.

Does it work in Google Sheets?

Yes, with the same syntax and function numbers, including 101 to ignore hidden rows.

How do I average visible rows and ignore errors?

Use AGGREGATE with function 101 and option 6, for example =AGGREGATE(101,6,D2:D500). That skips error values as well as hidden rows.

Can I use SUBTOTAL on a filtered PivotTable?

No. PivotTables have their own summary settings — set the value field to Average instead.