# AGGREGATE 函数

「自动筛选」已激活时，AGGREGATE 函数应用于数据的垂直范围。如果未激活「自动筛选」, 函数结果的自动重新计算不适用于新隐藏的行。尽管并非如此设计, 但可以应用于水平范围, 略有限制。即, 应用于水平数据范围的 AGGREGATE 函数无法识别隐藏列, 但可正确地忽略嵌入行中的 SUBTOTAL 函数和其他 AGGREGATE 函数的错误和结果。

### 语法

AGGREGATE(Function; Option; Number 1[; Number 2][; ... ;[Number 253]])

AGGREGATE(Function; Option; Array[; k])

1

AVERAGE

2

COUNT

3

COUNTA

4

MAX

5

MIN

6

PRODUCT

7

STDEV.S

8

STDEV.P

9

SUM

10

VAR.S

11

VAR.P

12

MEDIAN

13

MODE.SNGL

14

LARGE

15

SMALL

16

PERCENTILE.INC

17

QUARTILE.INC

18

PERCENTILE.EXC

19

QUARTILE.EXC

Option – 必填参数。选项索引或对值为 0 到 7 的单元格的引用，确定函数范围中忽略的内容。

0

1

2

3

4

5

6

7

Number1 – required argument. The first numeric argument (if the range is set by a list of values inside the function) or a reference to a cell that contains it.

Number2, 3, ... – optional. A numeric argument or a reference to a cell (up to 253 arguments), for which you need the aggregate value.

Array – required argument. The array can be specified by the boundaries of the range, the name of the named range or the column label.

k – required argument for the following functions: LARGE, SMALL, PERCENTILE.INC, QUARTILE.INC, PERCENTILE.EXC, QUARTILE.EXC. It is a numeric argument, which must correspond to the second argument of these functions.

### 示例

 A B C 「第一列」 「第二列」 「第三列」 34 11 12 10 56 35 #DIV/0! 5 3 20 8 1 0 8 9 #VALUE! 20 21 5 7 8 14 0 5

=AGGREGATE(4;2;A2:A9)
Returns maximum value for the range A2:A9 = 34.

=AGGREGATE(9;5;A5:C5)

=AGGREGATE(9;5;B2:B9)

=AGGREGATE(13;3;Sheet1.B2:B9:Sheet3.B2:B9)

=AGGREGATE(E3;E5;'ColumnOne')

#### Technical information

This function is available since LibreOffice 4.4.

This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

COM.MICROSOFT.AGGREGATE