[]
Calculates aggregate statistics for a range.
public double Aggregate(AggregateEnum aggType, CellRange rg, AggregateFlags flags)
Public Function Aggregate(aggType As AggregateEnum, rg As CellRange, flags As AggregateFlags) As Double
| 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)
Public Function Aggregate(aggType As AggregateEnum, topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer, flags As AggregateFlags) As Double
| 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)
Public Function Aggregate(aggType As AggregateEnum, flags As AggregateFlags) As Double
| 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)
Public Function Aggregate(aggType As AggregateEnum) As Double
| 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)
Public Function Aggregate(aggType As AggregateEnum, rg As CellRange) As Double
| 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)
Public Function Aggregate(aggType As AggregateEnum, topRow As Integer, leftCol As Integer, bottomRow As Integer, rightCol As Integer) As Double
| 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. |