Excel SUBTOTAL Function

The Excel SUBTOTAL function calculates subtotals and grand totals in a list for a column. Hence, The SUBTOTAL function can perform various calculations such as COUNT, SUM, AVERAGE, etc. Therefore, it helps in analysing the data provided.

What distinguishes the SUBTOTAL function from the regular TOTAL function is that the SUBTOTAL function always ignores values in cells that are hidden with a filter. However, you can only include the hidden items within the calculations if you apply them manually.

Syntax:

List of Microsoft Excel SUBTOTAL Functions
Microsoft Excel SUBTOTAL List

The excel SUBTOTAL performs 11 functions to analyse the data. In other words, these functions specify which function to use in calculating subtotals within a list. However, each function comes with two options, to either include manually hidden data or to exclude them. For more details, the below table shows all SUBTOTAL functions with the two available options:

FUNCTIONINCLUDE HIDDENEXCLUDE HIDDEN
AVERAGE1101
COUNT2102
COUNTA3103
MAX4104
MIN5105
PRODUCT6106
STDEV7107
STDEVP8108
SUM9109
VAR10110
VARP11111

Example 1

The following example calculates the SUM of all numbers that are in the range A2 through A10 when the filter is applied:

Example 2

The following example calculates the AVERAGE of all numbers that are in the range A2 through A10 when the filter is applied:

Example 3

The following example calculates the PRODUCT of all numbers that are in the range A2 through A10 when the filter is applied. PRODUCT Function multiply all numbers together in a range.

Microsoft Excel SUBTOTAL Function Example

More details in Microsoft Excel Subtotal Function