WorksheetFunction.Aggregate (Excel)

Returns an aggregate in a list or database.

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

Aggregate (Arg1, Arg2, ..., Arg30)

Dim dblArg1 As Double: dblArg1 = 
Dim dblArg2 As Double: dblArg2 = 
Dim dblAggregate As Double
dblAggregate = WorksheetFunction.Aggregate(Arg1:=dblArg1, Arg2:=dblArg2, Arg3:=)


Arg1, Arg2, ..., Arg30

Arg1 (Double) - Function_num - A number from 1 to 19 that specifies which function to use.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.

Arg2 (Double) - Option - A numerical value that determines which values to ignore in the evaluation range for the function.OptionBehavior 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.

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