SUBTOTAL Function

SUBTOTAL Function

The SUBTOTAL function in Excel is a versatile tool for performing various calculations on a filtered set of data.
SUBTOTAL function is excel. Excel SUBTOTAL function

Table of Contents

The SUBTOTAL function in Excel performs a specified calculation (e.g., sum, average, count) on a range of data, but unlike other similar functions, it adjusts automatically when the dataset is filtered. This means you can exclude hidden rows (either filtered or manually hidden) from the calculation.

Syntax of SUBTOTAL Function in Excel

=SUBTOTAL(function_num, ref1, [ref2], ...)
ArgumentDescription
function_name
(required)
A number that specifies the type of calculation, usually a function.
(e.g., 1 for AVERAGE, 9 for SUM)
ref1
(required)
The first cell range to include in the calculation.
[ref2]
(optional)
Additional cell ranges to include if needed.

Function Names in Excel SUBTOTAL Function

The number (1–11 or 101–111) specifies the function to use in the subtotal. Numbers 1–11 include manually hidden rows, while 101–111 ignore them; filtered-out cells are always excluded.

function_nameFunctionDescription
1101AVERAGECalculates the average of cells.
2102COUNTCounts numbers in cells.
3103COUNTACounts non-empty cells.
4104MAXFinds the maximum value in cells.
5105MINFinds the minimum value in cells.
6106PRODUCTMultiplies all cell values.
7107STDEVCalculates standard deviation of cells.
8108STDEVPPopulation standard deviation for cells.
9109SUMAdds up cells.
10110VARVariance of cells.
11111VARPPopulation variance of cells.

SUBTOTAL vs Other Functions

SUBTOTAL outperforms basic functions like SUM or COUNT. Here’s a comparison of SUBTOTAL and other functions.

FeatureSUM/COUNTSUBTOTAL
Includes filtered data onlyNoYes
Ignores hidden rowsNoYes (101-111)
Versatile (multiple calculations)NoYes

SUBTOTAL Function – Tips and Best Practices

  • Use with Filters: Always use SUBTOTAL in datasets where you frequently filter or hide rows for more accurate calculations.
  • Quick Access from Ribbon: When you apply filters, Excel’s status bar shows subtotals for selected cells by default. You can quickly copy these formulas by using the SUBTOTAL function.
  • Combine with Tables: Convert your dataset into an Excel Table. Tables automatically integrate filtering, and SUBTOTAL works seamlessly within them.

Conclusion

The SUBTOTAL function is a powerful tool that every Excel user should master. Its ability to dynamically adjust to filtered and hidden data makes it invaluable for analyzing datasets in real-time. Be it summing sales, counting entries, or finding the maximum value, SUBTOTAL helps keep your calculations accurate and flexible.

Frequently Asked Questions (FAQs)

  1. What is the Syntax of SUBTOTAL Function in Excel?

    The SUBTOTAL in Excel is a versatile tool for performing various calculations on a filtered data set. =SUBTOTAL(function_num, ref1, [ref2], ...) is the syntax of SUBTOTAL in Excel.

  2. What is the Difference Between SUM and SUBTOTAL Function?

    The SUM function adds all values in a range, regardless of whether the rows are hidden or filtered. The SUBTOTAL function, on the other hand, adjusts based on filters and can optionally ignore hidden rows.

  3. How to Exclude Hidden Rows using SUBTOTAL?

    To exclude hidden rows, use a function_num between 101 and 111. For example, to sum visible rows only: =SUBTOTAL(109, A1:A10).

  4. Can SUBTOTAL handle multiple ranges?

    Yes, SUBTOTAL can work with multiple ranges. For Example =SUBTOTAL(9, A1:A10, B1:B10). This sums up the visible rows from both ranges.

Share on

Leave a Reply

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