• Home
  • AGGREGATE function

AGGREGATE function

The AGGREGATE function is one of the math and trigonometry functions. The function is used to return an aggregate in a list or database. The AGGREGATE function can apply different aggregate functions to a list or database with the option to ignore hidden rows and error values.

Syntax

AGGREGATE(function_num, options, ref1, [ref2], ...)

The AGGREGATE function has the following arguments:

ArgumentDescription
function_numA numeric value that specifies which function to use. The possible values are listed in the table below.
optionsA numeric value that specifies which values should be ignored. The possible values are listed in the table below.
ref1The first numeric value for which you want the aggregate value.
ref2Up to 253 numeric values or a reference to the cell range containing the values for which you want the aggregate value. It is an optional argument.

The function_num argument can be one of the following:

function_numFunction
1AVERAGE
2COUNT
3COUNTA
4MAX
5MIN
6PRODUCT
7STDEV.S
8STDEV.P
9SUM
10VAR.S
11VAR.P
12MEDIAN
13MODE.SNGL
14LARGE
15SMALL
16PERCENTILE.INC
17QUARTILE.INC
18PERCENTILE.EXC
19QUARTILE.EXC

The options argument can be one of the following:

Numeric valueBehavior
0 or omittedIgnore nested SUBTOTAL and AGGREGATE functions
1Ignore hidden rows, nested SUBTOTAL and AGGREGATE functions
2Ignore error values, nested SUBTOTAL and AGGREGATE functions
3Ignore hidden rows, error values, nested SUBTOTAL and AGGREGATE functions
4Ignore nothing
5Ignore hidden rows
6Ignore error values
7Ignore hidden rows and error values
Notes

If you want to use one of the following functions: LARGE, SMALL, PERCENTILE.INC, QUARTILE.INC, PERCENTILE.EXC, or QUARTILE.EXC, ref1 must be a reference to the cell range and ref2 must be the second argument that is required for these functions (k or quart).

FunctionSyntax
LARGELARGE(array, k)
SMALLSMALL(array, k)
PERCENTILE.INCPERCENTILE.INC(array, k)
QUARTILE.INCQUARTILE.INC(array, quart)
PERCENTILE.EXCPERCENTILE.EXC(array, k)
QUARTILE.EXCQUARTILE.EXC(array, quart)

How to apply the AGGREGATE function.

Examples

The figure below displays the result returned by the AGGREGATE function when the SUM function is applied.

AGGREGATE Function

The figure below displays the result returned by the AGGREGATE function when the LARGE function is applied, ref1 is a reference to the cell range, and k is equal to 2. The function returns the second largest value in cells A1-A4.

AGGREGATE Function

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags