Summing only filtered (visible) cells in Excel can be a handy trick when dealing with large datasets. Using the SUBTOTAL function with the appropriate parameter, you can easily calculate the sum of only the visible cells in a filtered list. Here’s a quick guide to get you started.
How to Sum Only Filtered (Visible) Cells in Excel
These steps will teach you how to use the SUBTOTAL function to sum only the visible cells in a filtered list. By the end of this tutorial, you’ll be able to apply this technique to any dataset you’re working with.
Step 1: Select the cell where you want the sum to appear
Click on the cell where you want the sum of the filtered cells to be displayed. This will be the location for your SUBTOTAL function.
Choosing a suitable cell ensures that your results are clearly visible and easy to find.
Step 2: Enter the SUBTOTAL function
Type =SUBTOTAL( into the selected cell to start the function. This function is specifically designed to work with visible cells in filtered lists.
The SUBTOTAL function is versatile and can perform various operations, not just summing.
Step 3: Choose the correct function number
Add 9 (which stands for SUM) as the first argument in the SUBTOTAL function. It should look like this: =SUBTOTAL(9,
The number 9 tells Excel to perform a sum calculation. You can replace it with other numbers for different operations.
Step 4: Select the range of cells
After the comma, select the range of cells you want to sum, closing the parentheses. For example, =SUBTOTAL(9, A1:A10)
Ensuring the correct range is selected is crucial as it determines which cells are summed.
Step 5: Press Enter
Press the Enter key to complete the function. Your cell should now display the sum of only the visible cells in the selected range.
If some cells are hidden by filtering, they won’t be included in this sum, giving you the precise total you need.
Once these steps are completed, your selected cell will display the sum of the visible (filtered) cells in the chosen range. This is particularly useful when analyzing specific subsets of data without needing to manually adjust your sums.
Tips for Summing Only Filtered (Visible) Cells in Excel
- Check Filters: Ensure that your filter is correctly set up so that only the desired cells are visible.
- Use Different Function Numbers: Experiment with different function numbers in the SUBTOTAL function for other operations like averaging or counting.
- Named Ranges: Use named ranges to make your formulas easier to read and manage.
- Keep Formulas Simple: Avoid overly complex formulas to ensure they can be easily understood and maintained.
- Regular Updates: Regularly update your filters and formulas to reflect any changes in your dataset accurately.
Frequently Asked Questions
What is the difference between SUBTOTAL and SUM in Excel?
SUBTOTAL can ignore hidden rows, whereas SUM includes all cells in the range regardless of visibility.
Can I use SUBTOTAL for other operations?
Yes, SUBTOTAL can perform various functions such as averaging, counting, and more, depending on the function number used.
Do I need to filter my data to use SUBTOTAL?
No, but SUBTOTAL’s ability to ignore hidden cells is most useful when your data is filtered.
Can SUBTOTAL be used with non-contiguous ranges?
Yes, but you need to use multiple SUBTOTAL functions for each range and then sum their results.
Is SUBTOTAL affected by hidden columns?
No, SUBTOTAL only considers hidden rows, not columns.
Step-by-Step Summary
- Select the cell where you want the sum to appear.
- Enter the SUBTOTAL function.
- Choose the correct function number.
- Select the range of cells.
- Press Enter.
Conclusion
Summing only filtered (visible) cells in Excel is a straightforward yet powerful technique that can greatly enhance your data analysis capabilities. By using the SUBTOTAL function, you can ensure that only the data you are interested in is included in your calculations, making your results more relevant and accurate.
This method is especially useful for large datasets where manual adjustments would be impractical. With the tips provided, you can further optimize your use of the SUBTOTAL function, making your Excel workbooks more dynamic and easier to manage.
Don’t stop here; explore other functions and features in Excel to continue improving your data management skills. Happy Excel-ing!

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.