WorksheetFunction.Aggregate method (Excel)
Returns an aggregate in a list or database.
Syntax
expression.Aggregate (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg12, Arg13, Arg14, Arg15, Arg16, Arg17, Arg18, Arg19, Arg20, Arg21, Arg22, Arg23, Arg24, Arg25, Arg26, Arg27, Arg28, Arg29, Arg30)
expression A variable that represents a WorksheetFunction object.
Parameters
Name | Required/Optional | Data type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Arg1 | Required | Double | Function_num - A number from 1 to 19 that specifies which function to use.
|
||||||||||||||||||||||||||||||||||||||||
Arg2 | Required | Double | Option - A numerical value that determines which values to ignore in the evaluation range for the function.
|
||||||||||||||||||||||||||||||||||||||||
Arg3 | Required | Range | Ref1 - The first numeric argument for functions that take multiple numeric arguments for which you want the aggregate value. | ||||||||||||||||||||||||||||||||||||||||
Arg4 - Arg 30 | Optional | Variant | Ref2 - Ref30 - Numeric arguments 2 to 30 for which you want the aggregate value. |
Return value
Double
Remarks
The following constraints apply to the Ref arguments (Arg3 - Arg 30) based on the Function_num value.
Function_num | Ref1 | Ref2 | Ref3, Ref4, ? |
---|---|---|---|
1-13 | Valid types:
|
Valid types:
|
Valid types:
|
14-17 | Valid types:
|
Valid types:
|
No 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 3D references, Aggregate returns the #VALUE! error value.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.