Use AutoSum After Filtering


September 12, 2022 - by

Use AutoSum After Filtering

Problem: I need to total only the visible cells in a filtered data set.

Strategy: You can use the AutoSum icon after applying a filter. Normally, the AutoSum icon inserts a SUM function. When you apply a filter and then use AutoSum, Excel will insert a SUBTOTAL function instead. This function will ignore rows hidden by the Filter command. Follow these steps:


  • 1. Choose a cell in your data set. Select Data, Filter.

  • 2. Apply a filter to at least one column. Open the Customer dropdown and choose one customer.



  • 3. Select the first visible cells beneath your numeric columns. Below, the last visible row is 539, but the next blank cell is in row 568.

  • 4. Click the AutoSum icon and press Enter. Excel inserts a SUBTOTAL function that uses the correct syntax to skip rows hidden by the filter.

After applying a filter, go to the first blank row visible below your numeric columns. Press the AutoSum icon to insert formulas using the SUBTOTAL function. This gives you the total of the visible cells.
Figure 682. Excel inserts the SUBTOTAL function.

When you choose a different selections from the filter dropdown, the SUBTOTAL function will show the total for those visible.

Additional Details: During a seminar for the Fort Wayne IIA, someone added a great suggestion to this topic. Insert two blank rows at the top. Cut the formulas from the total row and paste to row 1. Now, even if the filtered rows are more than will fit on a screen, you always have the filtered totals at the top.


This article is an excerpt from Power Excel With MrExcel

Title photo by StellrWeb on Unsplash