Skip to main content
← All functions

SUBTOTAL function

Returns a subtotal in a list or database

Returns a subtotal in a list or database.

Syntax

SUBTOTAL(function_num, ref1, [ref2])

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
function_numYesThe 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.1
ref1YesThe first named range or reference for which you want the subtotal.A1:A20
ref2No · repeatsNamed ranges or references 2 to 254 for which you want the subtotal.B1:B20

Try SUBTOTAL

Subtotal an unhidden numeric source

=SUBTOTAL(109,A2:A6)

Function 109 selects a sum that can exclude filtered and manually hidden rows in Excel. This unhidden sample totals 50; hidden-row behavior needs a separate native check.

Inspect the current formula

Read its written arguments or observe actual operation values in a separate local calculation. This action neither applies a draft nor grades an answer.

Read the formula, one argument at a time

Explore the written function calls and their inputs. The calculation result belongs to the complete formula.

SUBTOTAL · top-level call

=SUBTOTAL(109,A2:A6)

1 / 2 · function_num

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.

SUBTOTAL reference ↗

Follow the cells behind a result

Read explicit local references and helper formulas using a separate calculation. Your draft stays in this field; the worksheet and practice checks do not change.

The worksheet runs locally. Published checks apply to the supplied example only. Native Excel and Google Sheets compatibility remain unverified.

Reference and compatibility

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.