[]
Calculates aggregate statistics for a range.
public double Aggregate(AggregateEnum aggType, CellRange rg, AggregateFlags flags)
Type | Name | Description |
---|---|---|
AggregateEnum | aggType | AggregateEnum value that specifies the type of aggregate to calculate. |
CellRange | rg | CellRange object that contains the values to be aggregated. |
AggregateFlags | flags | AggregateFlags value that specifies aggregation options. |
Type | Description |
---|---|
double | A double that represents the aggregate value. |
Calculates aggregate statistics for a range.
public double Aggregate(AggregateEnum aggType, int topRow, int leftCol, int bottomRow, int rightCol, AggregateFlags flags)
Type | Name | Description |
---|---|---|
AggregateEnum | aggType | AggregateEnum value that specifies the type of aggregate to calculate. |
int | topRow | Top row in the range. |
int | leftCol | Left column in the range. |
int | bottomRow | Bottom row in the range. |
int | rightCol | Right column in the range. |
AggregateFlags | flags | AggregateFlags value that specifies aggregation options. |
Type | Description |
---|---|
double | A double that represents the aggregate value. |
Calculates aggregate statistics for the selection.
public double Aggregate(AggregateEnum aggType, AggregateFlags flags)
Type | Name | Description |
---|---|---|
AggregateEnum | aggType | AggregateEnum value that specifies the type of aggregate to calculate. |
AggregateFlags | flags | AggregateFlags value that specifies aggregation options. |
Type | Description |
---|---|
double | A double that represents the aggregate value. |
Calculates aggregate statistics for the selection.
public double Aggregate(AggregateEnum aggType)
Type | Name | Description |
---|---|---|
AggregateEnum | aggType | AggregateEnum value that specifies the type of aggregate to calculate. |
Type | Description |
---|---|
double | A 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));
}
Calculates aggregate statistics for a range.
public double Aggregate(AggregateEnum aggType, CellRange rg)
Type | Name | Description |
---|---|---|
AggregateEnum | aggType | AggregateEnum value that specifies the type of aggregate to calculate. |
CellRange | rg | CellRange object that contains the values to be aggregated. |
Type | Description |
---|---|
double | A double that represents the aggregate value. |
Calculates aggregate statistics for a range.
public double Aggregate(AggregateEnum aggType, int topRow, int leftCol, int bottomRow, int rightCol)
Type | Name | Description |
---|---|---|
AggregateEnum | aggType | AggregateEnum value that specifies the type of aggregate to calculate. |
int | topRow | Top row in the range. |
int | leftCol | Left column in the range. |
int | bottomRow | Bottom row in the range. |
int | rightCol | Right column in the range. |
Type | Description |
---|---|
double | A double that represents the aggregate value. |