Documentation/How Tos/Calc: SUBTOTAL function

From OpenOffice.org Wiki

< Documentation | How Tos
Revision as of 14:40, 26 February 2009 by OOoWikiBot (Talk | contribs)
Jump to: navigation, search


SUBTOTAL

Returns SUM, AVERAGE, STDEV, etc. results for filtered data.

Syntax:

SUBTOTAL(function; range)

range is the overall range from which cells for calculation are selected by filtering.
function is a number that specifies the function to calculate, as follows:
functionFunction
1AVERAGE
2COUNT
3COUNTA
4MAX
5MIN
6PRODUCT
7STDEV
8STDEVP
9SUM
10VAR
11VARP
If range contains other SUBTOTAL functions they are ignored to avoid double counting.

Example:

example

You have a table in the cell range A1:B5 containing cities in column A and accompanying figures in column B. You have used an AutoFilter so that you only see rows containing the city Hamburg. You want to see the sum of the figures that are displayed; that is, just the subtotal for the filtered rows.

SUBTOTAL(9; B1:B5)

returns the desired result.



See Also

Filtering Cell Ranges

Personal tools
Create a book
In other languages