TTMSFNCCustomDataGrid.ColumnAverage Method
Returns the average of the numeric values in a column.
API unit family: TMSFNCDataGrid
Declaring type: TTMSFNCCustomDataGrid
Syntax
function ColumnAverage(AColumn: Integer; AFromRow: Integer = -1; AToRow: Integer = -1): Double;
double __fastcall ColumnAverage(int AColumn, int AFromRow = 0xffffffff, int AToRow = 0xffffffff);
Remarks
When either bound is -1, all rows between the fixed top and fixed bottom rows are used. Only base cells in default rows (not group, summary or node rows) are counted, and hidden rows are skipped unless Options.Calculations.IncludeHiddenRows is True. Non-numeric cells still count towards the divisor.
Parameters
| Name | Description |
|---|---|
AColumn |
Zero-based column index. |
AFromRow |
First row to include, or -1 (default) for the whole data range. |
AToRow |
Last row to include, or -1 (default) for the whole data range. |
Returns
Sum divided by the number of counted cells, or 0 when no cell is counted.