• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

How To SUM Filtered Data Using SUBTOTAL Function In Excel

How To SUM Filtered Data Using SUBTOTAL Function In Excel

Did you know that you can use the SUBTOTAL Function to SUM filtered data in Excel?

We all know filtering of data using either by inserting tables or by using filter feature in Sort and filter group.

For general adding operation, we use SUM Function. But when we filter the data the total displayed is of all the items in the data range. It doesn’t display the total of filtered data.

Excel has another function for this purpose. You can use the SUBTOTAL function to carry on this operation.

Let us understand it with an example.

We have a list of about 50 customers, their invoice numbers and their outstanding invoice amounts. We have already inserted tables for easy filtering of data.

Using SUM Function in Filtered Data

First of all, let us insert the SUM function in the last cell of Amounts.

SUM Filtered Data

Formula: =SUM(C2:C50)

Let’s filter the table for a particular customer say “Abhishek Cables”. While filtering you must keep in mind that checkbox nex to the required name is only checked.

SUM Filtered Data

You can see there is no change in the totals. This is because we have used the SUM Function.

Thus, using SUM Function isn’t solving our problem.

SUM Filtered Data Using SUBTOTAL Function

The solution to our problem lies in using the SUBTOTAL Function.

Change the formula from =SUM(C2:C50) to =SUBTOTAL(9,C2:C50) and see the magic.

SUM Filtered Data

In filtered list, SUBTOTAL always ignores values in hidden rows regardless of the function argument.

SUM Filtered Data

Now you can see that every time we choose a different name the total changes accordingly.

SUM Filtered Data

Click on the link below to download the excel file with the above sample data:

Sample File

Apart from SUM, you can use other operations like AVERAGE, COUNT, MAX, MIN, PRODUCT, STDEV, STDEVP, VAR and VARP with SUBTOTAL Function. You only need to change the respective function number argument.

SUM Filtered Data

Click here to learn how to use the SUBTOTAL Function.

To learn other financial function like CUMPRINC and ACCRINTM Functions, please click on the name of the function.

Additionally, you can download also accounting templates like Startup Costs Calculator, Salary Sheet and Sales Commission Calculator from here.

We thank our readers for liking, sharing and following us on different social media platforms.

If you have any queries please share in the comment section below. I will be more than happy to assist you.

Filed Under: Microsoft Excel

You are Here: Home / Reader's Question / How To SUM Filtered Data Using SUBTOTAL Function In Excel

About Shabbir Bhimani

I have worked in Excel and like to share functional excel templates at ExcelDataPro.

ExcelDataPro

Free Excel Pro Templates

  • Glossary
    • Accounting Glossary
    • HR & Payroll Glossary
    • Tax Glossary
  • Templates
    • Accounting
      • Financial Analysis
      • Financial Statement
    • Educational
    • Taxation
      • Federal Income Tax
      • GST
      • UAE VAT
      • UK VAT
    • Human Resources
      • HR & Payroll
      • HR Metrics
    • School Management
    • Social Media
    • Sales-Marketing
    • Personal Finance
    • Other
      • Health & Fitness
  • Functions
  • Calculators
  • Home
  • Contact
  • Privacy
  • Terms

© ExcelDataPro 2025. Content Licensed Under Creative Commons with Attribution Required

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT