In This Topic
Syntax
AVERAGE(arg1 [; ByEveryN])
Arguments
The 'arg1' argument must be an array.
ByEveryN is an optional argument - an integer constant, greater or equal to 1.
Result
Returns a scalar value, which is the average value of the elements in the array 'arg1'.
If the 'ByEveryN' parameter is supplied, then the function calculates the average value for each group of N successive elements and the result is an array.
Description
Calculates the average of the elements in the input array, or the average of every N successive elements in the input array.
Example 1:
Expression: AVERAGE( arg1 )
Result: 5.5
Example 2:
(average by every 2 elements)
Expression: AVERAGE( arg1; 2 )
arg1 |
11 |
7 |
3 |
5 |
6 |
1 |
result |
9 |
4 |
3.5 |
Related Examples
Windows Forms: All Examples\Data Manipulation\Functions\Average, Median, Min, Max