Function description
Returns a subtotal in a list.
grammar
SUBTOTAL(function_num,ref1,[ref2],...)
The SUBTOTAL function syntax has the following parameters:
Function_num is required. Numbers 1-11 or 101-111 specify the function to use for subtotals. If you use 1-11, manually hidden rows will be included, if you use 101-111, manually hidden rows will be excluded; filtered out cells will always be excluded.
Ref1 required. The first named range or reference for which subtotal calculations are to be performed.
Ref2,... Optional. The 2nd through 254th named range or reference for which subtotal calculations are to be performed.
Example
Copy the sample data from the table below and paste it into cell A1 of a new Excel worksheet. To make formulas display results, select them, press F2, and then press Enter. If needed, adjust column widths to see all data.