A.avg()

Read(231) Label: non-null member, average,

Description:

Compute the average value of the non-null members in a sequence.

Syntax:

A.avg()

Equivalent to avg(x1,…,xn)

Note:

The function computes the average value of the non-null members in a sequence, and is equal to A.sum()/A.count(). If the number of non-null members is 0, the average value will be null. Members that are not numerical values will be automatically skipped.

Parameters:

A

A sequence

Return value:

The average value of the non-null members in sequence A

Example:

 

A

 

1

=[1,3,5,6].avg()

3.75

2

=[2,null,4,3].avg()

3.0

3

=[].avg()

null

4

=[2,4,3,"aaa"].avg()

3.0 Skip members that are not numerical values

5

=avg(2,null,4,3)

3.0

Related functions:

A.sum()

A.count()

A.min()

A.max()

A.avg(x)