Calculation Issues

How to Calculate an Excel Average Based on Slicer Selection

Bushra ParveenBushra Parveen Oct 28, 2026 870 views

Question details

The user needs to calculate an average in Excel that dynamically updates to include only the visible data filtered by a slicer.

How to Calculate an Excel Average Based on Slicer Selection
Product
Excel
Device & OS
not provided
Scenario
Filtering data using a slicer and calculating the average of the displayed records.
Observed behavior
Standard average functions calculate all records, including those hidden by the slicer. The goal is to ignore hidden rows and calculate the average for visible records only.
Before you start

Ensure your dataset is formatted as an Excel Table or a PivotTable, as slicers require these formats to filter data effectively.

Solution 1Recommended

Use the SUBTOTAL Function for Dynamic Averages

The SUBTOTAL function is the most straightforward way to calculate averages that automatically ignore rows hidden by slicers or filters in a standard worksheet.

Standard functions like AVERAGE will evaluate every cell in the defined range, regardless of visibility. The SUBTOTAL function is specifically designed to perform calculations on filtered data.

1
Select the target cell

Click on an empty cell where you want the dynamic average to appear, preferably above or below your filtered table.

2
Enter the SUBTOTAL formula

Type =SUBTOTAL(101, [Range]). The number 101 specifies the AVERAGE function and forces Excel to ignore all hidden rows. Replace [Range] with your actual data range (e.g., C2:C100).

3
Test with your slicer

Click on different options in your slicer. The average calculation will now automatically update to reflect only the visible rows in your table.

Use the SUBTOTAL Function for Dynamic Averages
Understanding Function Numbers: Using the number 101 ignores both manually hidden rows and filtered rows. Using the number 1 ignores only filtered rows. For slicers, either will work, but 101 is generally recommended to prevent manual hiding from skewing your data.
Advanced Spreadsheet Capabilities

Calculate Dynamic Averages Easily with WPS Spreadsheet

WPS Office provides robust data analysis tools, including PivotTables, Slicers, and advanced formulas, allowing you to easily manage and calculate dynamic averages based on your filtered data.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the data you want to filter.
  2. 2. Format as Table and Insert Slicer: Highlight your data range, go to the Insert tab, and choose Table. Next, click Insert Slicer and select your filter categories to add interactive buttons.
  3. 3. Apply the SUBTOTAL formula: In an empty cell, enter =SUBTOTAL(101, YourRange) to calculate the dynamic average of the visible cells. Click your slicer buttons to see the average update instantly.
Fully compatible with Microsoft Excel formulas, including SUBTOTAL and AGGREGATE.Intuitive user interface for quickly inserting Slicers and formatting PivotTables.Lightweight performance that handles large datasets smoothly without crashing.Free to download and use with comprehensive data analysis features.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the standard AVERAGE function include hidden rows?

The standard =AVERAGE() function evaluates the entire specified cell range, regardless of whether rows are hidden by filters, slicers, or manual hiding. To calculate based only on visible cells, you must use functions specifically designed to ignore hidden rows, such as SUBTOTAL.

Can I use the AGGREGATE function instead of SUBTOTAL for slicers?

Yes, the AGGREGATE function is a highly robust alternative. You can use the formula =AGGREGATE(1, 5, [Range]), where the number '1' specifies the Average calculation and the number '5' tells the application to ignore hidden rows.

Why is my slicer greyed out or unclickable?

Slicers require your data to be formatted as an official Excel Table or a PivotTable. If your data is just a normal range of cells, the Insert Slicer option will be greyed out. Select your data and press Ctrl+T to convert it into a Table first.