Excel Subtotal Function – Avoid Double Counting

What does it do?

It returns a Subtotal in a list or database

Formula breakdown:

=SUBTOTAL(function_num, ref1)

What it means:

=SUBTOTAL(function number 1-11 includes manually-hidden rows & 101-111 excludes them, your list or range of data)

***Go to the bottom of this post to see what each value stands for

The SUBTOTAL function in Excel has many great features, like the ability to:

* Return a SUM, AVERAGE, COUNT, COUNTA, MAX or MIN from your data;

* Include hidden values within your data by entering the first argument function_num, as values between 1-11;

* Ignore hidden values within your data by entering the first argument function_num, as values between 101-111;

* Find the SUBTOTAL of filtered values;

* Ignore other SUBTOTALS that are included in your range, avoiding any double counting!


This is probably the most useful feature within the SUBTOTAL function!

Let’s say you have various SUBTOTALS within your data, one SUBTOTAL to Sum the North Region and another SUBTOTAL to Sum the South Region.

You can include a third SUBTOTAL for your Grand Total which references all of your data and ignoring the North & South Region SUBTOTALS, meaning that there is no double counting in your Grand Total.

See the below images of how this works with the SUBTOTAL function and how it double counts when using the SUM function:



Subtotal Sum

***Values for the SUBTOTAL function_num:

Includes hidden values     Ignores hidden values     Function      
2 102 COUNT
3 103 COUNTA
4 104 MAX
5 105 MIN
7 107 STDEV
8 108 STDEVP
9 109 SUM
10 110 VAR
11 111 VARP



How to Combine VLOOKUP and IFERROR to Replace the #N/A Error in Excel


If you like this Excel tip, please share itEmail this to someone


Pin on Pinterest


Share on Facebook


Tweet about this on Twitter


Share on LinkedIn


Related Posts

GETPIVOTDATA Function What does it do? A formula that extracts data stored in a Pivot Table Formula breakdown: =GETPIVOTDATA(data_field, pivot_table, , ,...) What it means: =GETPIVOTDATA(return me this value from the Values Area, any cell within the Pivot Table, ,...)   T...
Return the Last Value in a Column with the Offset ... What does it do? It returns a reference to a range, from a starting point to a specified number of rows, columns, height and width of cells Formula breakdown: =OFFSET(reference, rows, columns, , ) What it means: =OFFSET(start in this cell, go up/down a number of ro...
SUMIFS Function: Introduction   What does it do? Sums multiple criteria Formula breakdown: =SUMIFS(Sum_Range,Criteria_Range1,Criteria1,Criteria_Range2,Criteria2...) What it means: =SUMIFS(Return the Sum from this Range,Evaluate this Range,With this Criteria,Evaluate that Range,With t...
Consolidate with 3D Formulas in Excel 3D Formulas or References in Excel are a great way to consolidate data from multiple sheets. 3D Formulas reference several worksheets that have the same structure which allows you to consolidate by using the SUM function. Formula breakdown: SUM(Sheet1:Sheet4!A1) ...

Leave a Comment

Your email address will not be published. Required fields are marked *