Math and trigonometry

SUBTOTAL

Summarize a filtered list and optionally skip manually hidden rows.

Syntax

=SUBTOTAL(function_num, ref1, [ref2], …)

Worked example

Put 5, 6 and 7 in B2:B4. With every row visible the total is 18. Hide the row containing 6 and the result becomes 12.

=SUBTOTAL(109,B2:B4)

Result 18 with all three rows visible

Microsoft documentation

Check the arguments, supported editions and behavior of this function in Microsoft’s reference.

Microsoft reference

Search ExcelTutor