EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Certification Courses
  • 120+ Courses All in One Bundle
  • Login
Home Excel Excel Resources Excel Tips SUBTOTAL Formula in Excel
Secondary Sidebar
Excel Functions
  • Excel Tips
    • Recover Document in Excel
    • Excel Shortcut to Select Row
    • Excel Header Row
    • Excel Insert Button
    • Excel Translate
    • Budget in Excel
    • KPI Dashboard in Excel
    • Blank Invoice Excel Template
    • Write Formula in Excel
    • Auditing Tools in Excel
    • Autofit Row Height in Excel
    • Formatting Text in Excel
    • Add Rows in Excel Shortcut
    • Divide Cell in Excel
    • Compare Two Columns in Excel for Matches
    • Excel Troubleshooting
    • Unprotect Excel Workbook
    • Subtract Date in Excel
    • Carriage Return in Excel
    • Negative Numbers in Excel
    • Worksheets in Excel
    • Excel Match Multiple Criteria
    • Exponential Moving Average Formula
    • Sentence Case in Excel
    • Excel Reverse Order
    • Excel Timesheet Template
    • Weighted Average in Excel
    • CTRL Shift-Enter in Excel
    • Excel Expense Tracker
    • INDEX MATCH Function in Excel
    • Percent Change in Excel
    • Drag and Drop in Excel
    • Shade Alternate Rows in Excel
    • Excel Database Template
    • Inverse Matrix in Excel
    • New Line in Excel Cell
    • Format Cells in Excel
    • Excel Text with Formula
    • Project Management Template in Excel
    • Vlookup vs Index Match
    • Embedded in Excel
    • Count Colored Cells in Excel
    • Excel Hacks
    • Column Header in Excel
    • Database Function in Excel
    • Excel Spell Check
    • Linear Interpolation in Excel
    • Convert Excel to CSV
    • Excel Not Responding
    • Delta Symbol in Excel
    • Excel Mortgage Calculator
    • Excel Show Formula
    • Break Links in Excel
    • VLOOKUP Examples in Excel
    • Alternate Row Color Excel
    • Checklist in Excel
    • Microsoft Office Tips
    • Excel vs Access
    • Excel Change Case
    • Count Characters in Excel
    • Formula Bar in Excel
    • Invoice Template in Excel
    • Find and Replace in Excel
    • PowerPivot in Excel
    • Wildcard in Excel
    • Line Break in Excel
    • NULL in Excel
    • Text Formula in Excel
    • Family Tree in Excel
    • Insert Calendar in Excel
    • Page Setup in Excel
    • Search For Text in Excel
    • Switching Columns in Excel
    • 3D Cell Reference in Excel
    • Roadmap Template in Excel
    • Cell References in Excel
    • Excel Automation
    • Matching Columns in Excel
    • Evaluate Formula in Excel
    • How to Find Mean in Excel
    • How to Add Cells in Excel
    • Project Timeline in Excel
    • TODAY Formula in Excel
    • Poisson Distribution in Excel
    • YEAR Formula in Excel
    • REPLACE Formula in Excel
    • Create Spreadsheet in Excel
    • SEARCH Formula in Excel
    • HYPERLINK Formula in Excel
    • Pivot Table with Multiple Sheets
    • COLUMNS Formula in Excel
    • DAY Formula in Excel
    • RIGHT Formula in Excel
    • INDIRECT Formula in Excel
    • Excel IRR Formula
    • Pivot Table Sort
    • OR Formula in Excel
    • Pivot Table Formula in Excel
    • How to Edit Drop Down List in Excel?
    • WEEKDAY Formula in Excel
    • Chart Wizard in Excel
    • Time Difference in Excel
    • Lookup Table in Excel
    • SUBTOTAL Formula in Excel
    • LOOKUP Formula in Excel
    • Themes in Excel
    • Group Worksheets in Excel
    • Excel ISNUMBER Formula
    • 3D Maps in Excel
    • VLOOKUP Tutorial in Excel
    • Moving Columns in Excel
    • Grouping Columns in Excel
    • Excel Formula of Percentage
    • Excel Leading Zeros
    • Timesheet in Excel
    • Nested IF Formula in Excel
    • SUMIF Formula in Excel
    • Concatenation in Excel
    • Excel Insert Page Break
    • LEN Formula in Excel
    • Insert Comment in Excel
    • Excel Print
    • Fractions in Excel
    • Excel Add a Column
    • Borders in Excel
    • Excel Sum by Color
    • Excel vs Google Sheets
    • Calculate Percentage Increase in Excel
    • Excel Format Phone Numbers
    • Excel Search Box
    • Excel vs CSV
    • Excel vs Numbers
    • Excel Concatenate Date
    • Excel Bullet Points
    • Calculate Compound Interest in Excel
    • Find External Links in Excel
    • Excel Comma Style
    • Excel Remove Leading Spaces
    • Combine First and Last Name in Excel
    • How to Calculate Ratio in Excel
    • SUMPRODUCT Function with Multiple Criteria
    • Create Excel Template
    • Excel Greater than or Equal
    • Excel Keyboard Shortcuts
    • Excel Row vs Excel Column
    • Excel Operators
    • Excel Text Compare
    • Excel Uppercase Function
    • Excel Auto Numbering
    • Watermark in Excel
    • Excel Delete Row Shortcut
    • Excel Word Count
    • Row Count in Excel
    • Excel Grade Formula
    • Excel Percentage Difference
    • Excel Rows and Columns
    • Excel Group
    • Excel Move Columns
    • Excel Row Height
    • Excel Sparklines
    • Excel Drawing a line
    • Multiple IFS in Excel
    • Excel Strikethrough
    • Numbering in Excel
    • Share Excel Workbook
    • Excel Shortcut For Merge Cells
    • Excel OneDrive
    • Excel Track changes
    • Excel Hide Formula
    • Excel Filter Shortcuts
    • Excel 3D Reference
    • Protect Excel Workbook
    • Excel Moving Averages
    • Excel Row Limit
    • Excel Absolute Value
    • Excel Print Area
    • Excel Format Painter
    • Excel Separate text
    • Excel Autofit
    • Excel Columns to Rows
    • Excel Paste Shortcut Option
    • Excel Rows to Columns
    • Excel Insert Row Shortcut
    • Excel Extensions
    • Excel Unmerge Cells
    • Divide in Excel Formula
    • Excel Compare Two Columns
    • Not Equal To Excel
    • Excel Remove Duplicates
    • Excel Remove Spaces
    • Excel Calculate Age
    • Copy Excel Sheet
    • Excel Conditional Formatting Based on Another Cell Value
    • Excel Cell Reference
    • Excel Split Cell
    • Excel Circular Reference
    • Highlight Every Other Row in Excel
    • Errors in Excel
    • Excel Delete Pivot Table
    • Excel Pivot Table
    • Subtraction in Excel
    • Count Unique Values in Excel
    • Excel Highlight Duplicates
    • Excel Data Formatting
    • Random Numbers in Excel
    • Basic Excel Formulas
    • Page Numbers in Excel
    • Excel CAGR Formula
    • Excel Combine cells
    • IFERROR with VLOOKUP in Excel
    • Column Sort in Excel
    • Print Comments in Excel
    • Cheat Sheet of Excel Formulas
    • Remove Hyperlinks in Excel
    • Excel Drop Down List
    • Remove (Delete) Blank Rows in Excel
    • Relative Reference in Excel
    • Subscript in Excel
    • Superscript in Excel
    • Excel Insert Multiple Rows
    • Excel Absolute Reference
    • Unhide Columns in Excel
  • Excel Functions (12+)
  • Excel Tools (114+)
  • Financial Functions in Excel (17+)
  • Logical Functions in Excel (14+)
  • Lookup Reference Functions in Excel (35+)
  • Maths Function in Excel (47+)
  • TEXT and String Functions in Excel (26+)
  • Date and Time Function in Excel (24+)
  • Statistical Functions in Excel (59+)
  • Information Functions in Excel (4+)
  • Excel Charts (56+)
  • Workplace Productivity (4+)
  • Microsoft Office Tools (15+)
  • Excel Formula and Functions (22+)
  • MS Excel Shortcuts (4+)
Excel Functions Courses
  • EXCEL COURSE
  • Online Excel Data Analysis Course
  • Excel for Finance Course

SUBTOTAL Formula in Excel

By Madhuri ThakurMadhuri Thakur

SUBTOTAL formula in Excel

SUBTOTAL Formula in Excel (Table of Contents)

  • SUBTOTAL Formula in Excel
  • How to Use SUBTOTAL Formula in Excel?

SUBTOTAL Formula in Excel

The function that returns subtotal from a list or database can be defined as the Subtotal function. Subtotal is a special function compared to other excel functions because other excel functions will perform only one specific operation, but the speciality of subtotal function is, it performs not only a subtotal calculation but also multiple arithmetics and logical operations depend on the function number.

Start Your Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

All in One Excel VBA Bundle(120+ Courses, 30+ Projects)
Basic ExcelAdvanced ExcelVBA & MacrosExcel Dashboards
Pivot TablesStatistical FunctionsFinancial FunctionsCharts & Graphs
Price
View Courses
120+ Online Courses | 30+ Projects | 500+ Hours | Verifiable Certificates | Lifetime Access
4.9 (64,368 ratings)

Sometimes we need to find the subtotal of a category from a large set of data that has multiple categories. In that kind of situation subtotal function will help us to find the total category-wise. Not only subtotal, but we can also calculate the average, count and max, and many more.

Syntax of SUBTOTAL Formula

Subtotal excel syntax

Arguments:

Function num: It refers to the type of mathematical operation we are going to perform on a specified range of data.

Ref1, Ref 2: It refers to the range of cells.

There are multiple numbers of function numbers available, but no problem, we no need to remember all these function numbers because, while using the SUBTOTAL formula, excel will automatically show you the list of function numbers available as below.

subtotal syntax 2

You must be wondering why there is two function number for the same function.

  • 1 – 11 function numbers should use when we want to ignore the filtered-out cells and consider the manually hidden cells.
  • 101 – 111 function numbers should be used when we want to ignore all the hidden cells filtered out and manually hidden cells.

We will see a few examples to understand how the subtotal function will work for different function numbers.

How to Use SUBTOTAL Formula in Excel?

SUBTOTAL Formula in Excel is very simple and easy. Let’s understand how to use the SUBTOTAL Formula in Excel with some examples.

You can download this SUBTOTAL Formula Excel Template here – SUBTOTAL Formula Excel Template

Example #1

Consider a small table that has data from different categories as below.

SUBTOTAL Formula in Excel Example 1-1

If you observe the above table, we have Product category, Color category, and Quantity.

Apply the SUBTOTAL Formula as below with function number 9.

SUBTOTAL Formula in Excel example 1-2

After applying this formula, the result is as shown below.

subtotal-example-1-3-1

Apply the SUBTOTAL Formula as below with function number 109.

subtotal-in-excel-example-1-4-2

After applying the SUBTOTAL Formula, the result is shown below.

subtotal-in-excel-example-1-5-2

In the Formula, we have used both function number 9 and 109 for performing SUM in two different columns. C2:C9 is the range of data that we are performing calculations.

Now, the total sum is 385 for both formulas. Hide a few rows and observe the results for both formulas.

SUBTOTAL Formula in Excel example 1-6

After applying the SUBTOTAL Formula, the result is shown below.

subtotal-example-1-7-1

Rows from 50 to 60 are hidden; hence the results of function number 109 have changed to 255 because it does not consider the manually hidden data, whereas function number 9 total remains the same, which means it will consider the data even though we hide the data manually.

Apply filter to the data and filter only one color; here, we are selected the Black Color.

SUBTOTAL Formula in Excel example 1-8

After applying the SUBTOTAL Formula, the result is as shown below.

SUBTOTAL Formula in Excel example 1-9

Apply the SUBTOTAL Formula as below with Function Number 109.

SUBTOTAL Formula in Excel example 1-10

After applying the SUBTOTAL Formula, the result is as shown below.

SUBTOTAL Formula in Excel example 1-10

If we observe the above screenshot, both the function numbers did not consider the quantity of filtered out data. After you filter out the data and hide rows, then both formulas will give the same results that both formulas will not consider non-visible data.

SUBTOTAL Formula in Excel example 1-12

After applying the SUBTOTAL Formula, the result is as shown below.

SUBTOTAL Formula in Excel example 1-13

Apply the SUBTOTAL Formula as below with Function Number 109.

SUBTOTAL Formula in Excel example 1-15

After applying this formula, the result is as shown below.

SUBTOTAL Formula in Excel example 1-15

Example #2

Up to now, we have seen SUM operation; now, we will perform the AVERAGE operation with the same data range. 1 and 101 are the function numbers to perform average. Go through the above table for the function numbers details.

subtotal example 2-1

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 2-2

For the next cell, apply the SUBTOTAL Formula again with function number 109.

subtotal example 2-3

After applying the formula, the result is as shown below.

subtotal example 2-4

With the same SUBTOTAL Formula, we can also calculate the average with the only change in Function Number.

subtotal example 2-5

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 2-6

For the next cell, apply the SUBTOTAL Formula again with Function Number 101.

subtotal example 2-7

After applying the SUBTOTAL Formula, the result is shown below.

subtotal example 2-8

Hide a few rows; now observe the changes in the average. The average with function number 1 remains the same as still; it also considers the hidden quantity. The average with function number 101 changed because it ignores the manually hidden data. Like this, you can try the rest of the function numbers and check the functionality of each as the basic concept is the same; they also will work in the same way.

Example #3

Subtotal has one more advantage: it will not consider any subtotals available in the range of data. We will see one example to understand better. Input formulas to perform SUM operation product-wise like A, B, C, and D. It is not mandatory that it should be product-wise; you can do it by color-wise also.

subtotal example 3-1

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 3-2

Use the SUBTOTAL Formula again to check the SUM of B.

subtotal example 3-3

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 3-4

Use the SUBTOTAL Formula again to check the SUM of C.

subtotal example 3-5

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 3-6

Use the SUBTOTAL Formula again to check the SUM of D.

subtotal example 3-6

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 3-8

Use the SUBTOTAL Formula again to the next cell.

subtotal example 3-9

After applying the SUBTOTAL Formula, the result is as shown below.

subtotal example 3-10

Use the SUBTOTAL Formula again to the next cell.

subtotal example 3-11

After applying the SUBTOTAL Formula, the result is shown below.

subtotal example 3-12

If we observe the above screenshots, there is a sum by-product wise, and while performing the total sum, we included the category-wise totals into the total sum (cells from 36 to 48), but it will not consider that subtotals (cells from 44 to 47). So, we can calculate the subtotals in between the data range without affecting the total sum value.

I hope you understand how to use the subtotal and the use of it.

Things to Remember

  • While giving the function number, do not give the number which is out of the function number range as excel does not predefine it; we will get an error message. We should always give the number between 1 to 11 and 101 to 111 otherwise; it will throw the error message #value.
  • While using the division operation, remember no number should be divisible by zero. That means x/0 is an incorrect format.
  • If you apply the subtotal for horizontal data from A1 : F1, hiding any columns will not impact the subtotal.
  • While applying subtotal, if any cells do not have data or non-numeric data, the function will ignore those cells.
  • Use the function numbers by understanding the functionality and use otherwise; you might not get the correct results as you expect.

Recommended Articles

This has been a guide to the SUBTOTAL Formula in Excel. Here we discuss How to Use the SUBTOTAL Formula in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles-

  1. Excel IRR Formula
  2. Left TRIM in Excel
  3. VLOOKUP Tutorial in Excel
  4. Excel ISNUMBER Formula
Popular Course in this category
Excel Training (23 Courses, 9+ Projects)
  23 Online Courses |  9 Hands-on Projects |  110+ Hours |  Verifiable Certificate of Completion
4.9
Price

View Course

Related Courses

Excel Data Analysis Training (17 Courses, 8+ Projects)4.9
Excel for Finance Training (18 Courses, 7+ Projects)4.8
2 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Excel Charts
  • Excel Tips
  • All Tutorials
Certification Courses
  • All Courses
  • Excel VBA Course - All in One Bundle
  • VBA Course
  • Excel Data Analysis Course
  • Excel for Marketing Course
  • Excel for Finance Course
  • Excel for HR Training

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

Download SUBTOTAL Formula Excel Template

EDUCBA

Download SUBTOTAL Formula Excel Template

EDUCBA

डाउनलोड SUBTOTAL Formula Excel Template

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more