Aggregate(AggregateEnum) Method
Calculates aggregate statistics for the selection.
Parameters
- aggType
- AggregateEnum value that specifies the type of aggregate to calculate.
Return Value
A
System.Double that represents the aggregate value.
The code below
Aggregate(AggregateEnum,CellRange,AggregateFlags) method to calculate aggregate statistics for the selection. Whenever the selection changes, new aggregates are calculated and written to the console.
void flex_SelChange(object sender, System.EventArgs e)
{
string fmt = "Count {0:0}, Sum {1:#,##0.00}, " +
"Avg {2:#,##0.00}, Stdev {3:#,##0.00}";
Console.WriteLine(fmt,
flex.Aggregate(AggregateEnum.Count),
flex.Aggregate(AggregateEnum.Sum),
flex.Aggregate(AggregateEnum.Average),
flex.Aggregate(AggregateEnum.Std));
}