0% found this document useful (0 votes)
13 views

SUBTOTAL function

The document provides an overview of the SUBTOTAL function in Microsoft Excel, detailing its syntax and usage for calculating subtotals in lists or databases. It explains the function's arguments, including function_num and references, and highlights the difference between including and excluding hidden rows. Additionally, examples are provided to illustrate how to use the SUBTOTAL function effectively.

Uploaded by

Glenn Boneo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

SUBTOTAL function

The document provides an overview of the SUBTOTAL function in Microsoft Excel, detailing its syntax and usage for calculating subtotals in lists or databases. It explains the function's arguments, including function_num and references, and highlights the difference between including and excluding hidden rows. Additionally, examples are provided to illustrate how to use the SUBTOTAL function effectively.

Uploaded by

Glenn Boneo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Microsoft 365

SupportOffice All Microsoft

Products
Search
Excel / Formulas and functions / More functions / SUBTOTAL function

Devices

SUBTOTAL function Account & billing

Resources
Applies To

Buy Microsoft 365

Effortlessly highlight, filter, and sort data with Copilot in Excel


We're giving you a free trial of Copilot Pro.

Activate now

This article describes the formula syntax and usage of the SUBTOTAL function in Microsoft
Excel.

Description
Returns a subtotal in a list or database. It is generally easier to create a list with subtotals by
using the Subtotal command in the Outline group on the Data tab in the Excel desktop
application. Once the subtotal list is created, you can modify it by editing the SUBTOTAL
function.

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

The SUBTOTAL function syntax has the following arguments:

Function_num Required. The number 1-11 or 101-111 that specifies the function
to use for the subtotal. 1-11 includes manually-hidden rows, while 101-111 excludes
them; filtered-out cells are always excluded.

Was this information helpful? Yes No


×
Function_num Function_num Function
(includes hidden rows) (ignores hidden rows)

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

Ref1 Required. The first named range or reference for which you want the
subtotal.

Ref2,... Optional. Named ranges or references 2 to 254 for which you want the
subtotal.

RemarksWas this information helpful? ×


If there are other subtotals within ref1, ref2,… (or nested subtotals), these nested
subtotals are ignored to avoid double counting.

For the function_num constants from 1 to 11, the SUBTOTAL function includes the
values of rows hidden by the Hide Rows command under the Hide & Unhide
submenu of the Format command in the Cells group on the Home tab in the Excel
desktop application. Use these constants when you want to subtotal hidden and
nonhidden numbers in a list. For the function_Num constants from 101 to 111, the
SUBTOTAL function ignores values of rows hidden by the Hide Rows command. Use
these constants when you want to subtotal only nonhidden numbers in a list.

The SUBTOTAL function ignores any rows that are not included in the result of a
filter, no matter which function_num value you use.

The SUBTOTAL function is designed for columns of data, or vertical ranges. It is not
designed for rows of data, or horizontal ranges. For example, when you subtotal a
horizontal range using a function_num of 101 or greater, such as
SUBTOTAL(109,B2:G2), hiding a column does not affect the subtotal. But, hiding a
row in a subtotal of a vertical range does affect the subtotal.

If any of the references are 3-D references, SUBTOTAL returns the #VALUE! error
value.

Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel
worksheet. For formulas to show results, select them, press F2, and then press Enter. If you
need to, you can adjust the column widths to see all the data.

Data

120

10

150

23
Was this information helpful?
×
Data

Formula Description Result

=SUBTOTAL(9,A2:A5) The sum of the subtotal of the cells A2:A5, 303


using 9 as the first argument.

=SUBTOTAL(1,A2:A5) The average of the subtotal of the cells A2:A5, 75.75


using 1 as the first argument.

Notes

The SUBTOTAL function always requires a numeric argument (1 through 11, 101 through
111) as its first argument. This numeric argument is applied to the subtotal of the values
(cell ranges, named ranges) that are specified as the arguments that follow.

Need more help?

How can we help you? 

Want more options?

 Discover  Community

Explore subscription benefits, browse training courses, learn how to secure your device, and
more.

Was this information helpful?


×
Microsoft 365 Microsoft 365 Microsoft security Accessibility center
subscription training
benefits

What's new Microsoft Education Business Developer & Company


Store IT
Surface Pro Microsoft in Microsoft Cloud Careers
Account profile education Azure
Surface Laptop Microsoft Security About Microsoft
Download Devices for Microsoft
Surface Laptop Center education Dynamics 365 Developer Company news
Studio 2
Microsoft Store Microsoft Teams Microsoft 365 Documentation Privacy at
Surface Laptop Go support for Education Microsoft
3 Microsoft Power Microsoft Learn
Returns Microsoft 365 Platform Investors
Microsoft Copilot Education Microsoft Tech
Order tracking Microsoft Teams Community Diversity and
AI in Windows How to buy for inclusion
Certified your school Microsoft 365 Azure
Explore Microsoft Refurbished Copilot Marketplace Accessibility
products Educator training
Microsoft Store and Small Business AppSource Sustainability
Windows 11 apps Promise development
Visual Studio
Flexible Deals for
Payments students and
parents

Azure for
students

 English (United States) Your Privacy Choices Consumer Health Privacy

Sitemap Contact Microsoft Privacy Terms of use Trademarks Safety & eco Recycling

About our ads © Microsoft 2025

Was this information helpful?


×

You might also like