How to subtotal only the visible cells after filtering in Excel?
Supposing you have calculated the total value from a column with the Sum function. When filtering data in the column, the Sum function adds both the visible cells and the hidden cells. If you only want to subtotal the visible cells after filtering, methods in this tutorial will help you.
Subtotal only visible cells after filtering with the Subtotal function
Subtotal only visible cells after filtering with an amazing tool
Subtotal only visible cells after filtering with the Subtotal function
Actually, the Subtotal function can help you to sum only the visible cells after filtering in Excel. Please do as follows.
Syntax
=SUBTOTAL(function_num,ref1,[ref2],…)
Arguments
- Funtion_num (Required): A number from 1 to 11 or 101 to 111 that specifies the function to use for the subtotal.
- Ref1 (Required): A named range or reference you want to subtotal.
- Ref2 (Optional): A named range or reference you want to subtotal.
1. Select a blank cell, copy the below formula into it and press the Enter key.
=SUBTOTAL(9,C2:C13)
Note:
- In the formula, number 9 means that you specify the sum function to the subtotal; C2:C13 is the range you will subtotal.
- You can change the number 9 to any number mentioned in the below table based on your needs.
Function_num (includes manually hidden rows) |
Function_num (excludes manually hidden rows) |
Function |
1 | 101 | AVERAGE |
2 | 102 | COUNT |
3 | 103 | COUNTA |
4 | 104 | MAX |
5 | 105 | MIN |
6 | 106 | PRODUCT |
7 | 107 | STDEV |
8 | 108 | STDEVP |
9 | 109 | SUM |
10 | 110 | VAR |
11 | 111 | VARP |
From now on, when you filter the column data, the SUBTOTAL function only sum the visible cells as the below screenshot shown.
Subtotal only visible cells after filtering with an amazing tool
Before applying Kutools for Excel, please download and install it firstly.
1. Select a blank cell to output the result, click Kutools > Kutools Functions > Statistical & Math > SUMVISIBLE. See screenshot:
2. In the Function Arguments dialog, select the range you will subtotal and then click the OK button.
Then you can see a formula is created in the selected cell. When you filter the column data, only the visible cells are summed.
If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.
Related articles
Only delete visible rows or columns in Excel
In Excel, we usually hide some important rows or columns of information, sometimes, we need to delete the visible rows or columns only, if you delete them with Delete key directly, the hidden values will be deleted at the same time. How do you delete the visible rows or columns without deleting the hidden rows or columns in Excel? This tutorial will introduce the ways to delete visible rows only.
Sum values without or exclude subtotals in Excel
Supposing you have a list of data mixed with several subtotal cells, when you need to sum the total, all the subtotals are included in the final summing. See screenshot below. For summing values without the subtotals in Excel, what would you do? In this article, we will show you a quick method to achieve it.
Filter multiple columns simultaneously in Excel
When you apply the Filter function, after filtering one column, the next columns will be only filtered based on the result of the previous filtered column. It means that only AND criteria can be applied to more than one column. In this case, how could you apply both the AND and OR criteria to filter multiple columns simultaneously in Excel worksheet? Thy the method in this article.
Filter or select cells by cell color in Excel
Normally you can fill cells with different colors for any purposes in Excel. If you have a worksheet with using different colors to indicate different type of contents and you want to filter or select those cells by the cell color, you may get it done with the methods in this tutorial:
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
