編輯

共用方式為


WorksheetFunction.Aggregate Method

Definition

Returns an aggregate in a list or database.

public double Aggregate (double Arg1, double Arg2, Microsoft.Office.Interop.Excel.Range Arg3, object Arg4, object Arg5, object Arg6, object Arg7, object Arg8, object Arg9, object Arg10, object Arg11, object Arg12, object Arg13, object Arg14, object Arg15, object Arg16, object Arg17, object Arg18, object Arg19, object Arg20, object Arg21, object Arg22, object Arg23, object Arg24, object Arg25, object Arg26, object Arg27, object Arg28, object Arg29, object Arg30);
Public Function Aggregate (Arg1 As Double, Arg2 As Double, Arg3 As Range, Optional Arg4 As Object, Optional Arg5 As Object, Optional Arg6 As Object, Optional Arg7 As Object, Optional Arg8 As Object, Optional Arg9 As Object, Optional Arg10 As Object, Optional Arg11 As Object, Optional Arg12 As Object, Optional Arg13 As Object, Optional Arg14 As Object, Optional Arg15 As Object, Optional Arg16 As Object, Optional Arg17 As Object, Optional Arg18 As Object, Optional Arg19 As Object, Optional Arg20 As Object, Optional Arg21 As Object, Optional Arg22 As Object, Optional Arg23 As Object, Optional Arg24 As Object, Optional Arg25 As Object, Optional Arg26 As Object, Optional Arg27 As Object, Optional Arg28 As Object, Optional Arg29 As Object, Optional Arg30 As Object) As Double

Parameters

Arg1
Double

Function_num - A number from 1 to 19 that specifies which function to use.

Arg2
Double

Options - A numerical value that determines which values to ignore in the evaluation range for the function.

Arg3
Range

Ref1 - The first numeric argument for functions that take multiple numeric arguments for which you want the aggregate value.

Arg4
Object

Ref2 - Ref30 - Numeric arguments 2 to 30 for which you want the aggregate value.

Arg5
Object
Arg6
Object
Arg7
Object
Arg8
Object
Arg9
Object
Arg10
Object
Arg11
Object
Arg12
Object
Arg13
Object
Arg14
Object
Arg15
Object
Arg16
Object
Arg17
Object
Arg18
Object
Arg19
Object
Arg20
Object
Arg21
Object
Arg22
Object
Arg23
Object
Arg24
Object
Arg25
Object
Arg26
Object
Arg27
Object
Arg28
Object
Arg29
Object
Arg30
Object

Returns

Remarks

The following constraints apply to the Ref arguments (Arg3 - Arg 30) based on the Function_num value.

1-13Valid types:Any cell reference Unions Intersections Defined names Structured referencesInvalid types: Actual data ArraysValid types:Any cell reference Unions Intersections Defined names Structured referencesInvalid types: Actual data ArraysValid types:Any cell reference Unions Intersections Defined names Structured referencesInvalid types: Actual data Arrays
14-17Valid types:Any cell reference Unions Intersections Defined names Structured references Actual data ArraysValid types:Any cell reference Unions Intersections Defined names Structured references Actual data ArraysNo references are allowed

If a second ref argument is required but not provided, AGGREGATE returns a #VALUE! error.

If one or more of the references are 3-D references, AGGREGATE returns the #VALUE! error value.

Applies to