ExcelCSE.com

Menu
  • Excel 101
  • Excel Functions
  • Excel Formula
  • Contact Us
How to Use Excel > Excel Functions > Excel SUBTOTAL Function

Excel SUBTOTAL Function

How to Use the Excel SUBTOTAL Function
Table of contents :
  • What is the Excel SUBTOTAL Function?
  • SUBTOTAL Syntax
  • How to Use SUBTOTAL Function in Excel
  • SUBTOTAL Example

Excel SUBTOTAL Function

What is the Excel SUBTOTAL Function?

The Excel SUBTOTAL function returns a value from 11 available functions such as SUM, COUNT, AVERAGE, MIN, MAX, etc. (see table below for complete function list) with an option to include or exclude the hidden rows.

Another way to calculate subtotals is using the “Subtotal” command in the “Outline” group on “Data” tab

Use Excel AGGREGATE function for more functions and options. The AGGREGATE function has 19 available function and eight options

SUBTOTAL Syntax

SUBTOTAL(function_num,ref1,[ref2],...)

function_num, required. The number 1-11 or 101-111, specifies which function to use for subtotal calculation (see table below for full list).

ref1, required, the first range or reference to include in the subtotal calculation.

[ref2], optional, the other range or reference to include in the subtotal calculation. Handles up to 254 range/reference.

Available function

function_num argument determines the SUBTOTAL function return values. The table below shows the available function_num and the corresponding functions.

Excel SUBTOTAL

Usage note:

  • function_num between 1-11, SUBTOTAL includes rows that manually hidden.
  • function_num between 101-111, SUBTOTAL ignores rows that manually hidden.
  • SUBTOTAL ignores rows that are hidden by a filter. “Filtered out” rows are not included, regardless of function_num number.
  • SUBTOTAL ignores other SUBTOTAL in ref argument to avoid double-counting.
  • SUBTOTAL designed for vertical ranges. In Horizontal ranges, values in hidden columns are always included, hiding a column does not affect the subtotal, even using the 101-111 function_num.

How to Use SUBTOTAL Function in Excel

For example, there is data as shown below. Numbers 1 to 10 are in row 2 to row 11. Cell C13, C14 and C15 contain a formula.

SUBTOTAL Formula in Excel

What are the results of the SUM, SUBTOTAL 9 and SUBTOTAL 109 function

  • If no hidden rows
  • If there are hidden rows with “Hide Rows” menu (/, H, O, U, R)
  • If there are hidden rows with “Filter” menu (CTRL+SHIFT+L)

 

If no hidden rows the results are as shown below.

How to SUBTOTAL in Excel

If no hidden rows, there is no different result for the SUM, SUBTOTAL 9 and SUBTOTAl 109 functions.

***

The 5th to 8th rows are manually hidden with “Hide Rows” menu (/, H, O, U, R), the results are as shown below.

How to Use SUBTOTAL in Excel

The SUM function and the SUBTOTAL 9 (include hidden rows) function returns the same results, while the SUBTOTAL 109 (exclude hidden rows) function returns the sum of visible cells only.

***

The 5th to 8th rows are hidden with “Filter ” menu (CTRL+SHIFT+L), the results are as shown below.

SUBTOTAL Feature in Excel

The SUBTOTAL 9 and SUBTOTAL 109 functions return the same results, sum only visible cells, while the SUM function keeps the sum visible and invisible numbers.

The Verdict

The SUM function returns the same results regardless of the conditions, no hidden rows, manually hidden rows or “filtered out” hidden rows.

The SUBTOTAL 9 function returns the same result as the SUM function if there are manually hidden rows.

The SUBTOTAL 109 function sum only visible cells, no matter manually hidden rows or “filtered out” hidden rows.

SUBTOTAL Example

Another article using or explain about SUBTOTAL Function

Another Math Function

Another article about Math Function
  • Excel SUBTOTAL Function
  • Excel AGGREGATE Function
  • Excel PRODUCT Function
  • Excel CONVERT Function
  • Excel SUMIFS Function
  • Excel SUMIF Function
  • Excel SUM Function
  • Excel SUMPRODUCT Function
  • Excel QUOTIENT Function
  • Excel MOD Function
Usefull links
  • Microsoft SUBTOTAL function documentation
Share
Tweet
Google+
Email
Prev Article
Next Article

Related Articles

Excel AVERAGEIF Function
What is the Excel AVERAGEIF Function? The Excel AVERAGEIF function …

Excel AVERAGEIF Function

Excel MID Function
What is the Excel MID Function? The excel MID function …

Excel MID Function

INDEX MATCH Excel
INDEX MATCH Formula You can use the INDEX function and …

INDEX MATCH – Excel VLOOKUP Alternative

Excel REPT Function
What is the Excel REPT Function? The excel REPT function …

Excel REPT Function

How to Use Excel IFS Function
What is the Excel IFS Function? Excel IFS Function is …

Excel IFS Function

Tags:Excel SUBTOTAL Excel SUBTOTAL 109 Excel SUBTOTAL 9 Excel SUBTOTAL Count Excel SUBTOTAL COUNTIF Excel SUBTOTAL IF Excel SUM Filtered Data Excel SUM Only Visible Cells Excel Table SUBTOTAL How Do You SUBTOTAL in Excel How to Do SUBTOTAL in Excel How to Find SUBTOTAL How to Get SUBTOTAL in Excel How to SUBTOTAL in Excel How to Use SUBTOTAL Formula in Excel How to Use SUBTOTAL Function in Excel How to Use SUBTOTAL in Excel Math Function SUBTOTAL 109 SUBTOTAL 9 SUBTOTAL Example SUBTOTAL Feature in Excel SUBTOTAL Formula in Excel SUM Filtered Cells SUM Only Visible Cells Using SUBTOTAL in Excel

Categories

  • Excel 101
  • Excel Formula
  • Excel Functions

Recent Posts

  • Get the Original Price from Percentage Increase/Decrease
  • How to Add/Subtract Percentage in Excel
  • How to Extract Day, Month and Year from Date in Excel
  • How to Add Seconds, Minutes and Hours to a Time in Excel
  • How to Add Days, Weeks, Months and Years to a Date in Excel
  • How to Calculate Time Difference in Excel
  • Calculate Number of Days, Weeks, Months and Years Between Two Dates in Excel
  • Flash Fill Excel
  • Paste Special Excel
  • Excel TEXTJOIN Function
  • Excel CONCAT Function
  • Excel CONCATENATE Function
  • Excel REPLACE Function
  • Excel SUBSTITUTE Function
  • Excel REPT Function
  • Excel FIND Function
  • Excel SEARCH Function
  • Excel MID Function
  • Excel RIGHT Function
  • Excel LEFT Function

ExcelCSE.com

The Ultimate Guide How to Use Excel Better
Copyright © 2024 ExcelCSE.com
Contact Us - Privacy Policy - Sitemap | Theme by MyThemeShop.com

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh