Skip to main content

SUMMATION

Adds the values of the elements of a multi-level dynamic array.

Synopsis

SUMMATION(dynarray)

Arguments

dynarray An expression that resolves to a dynamic array of numeric values.

Description

The SUMMATION function adds the values of all of the elements in a dynamic array and returns the sum. If an element is missing, or has a null string or a non-numeric value, SUMMATION parses its value as 0 (zero).

The SUMMATION function adds all dynamic array values, regardless of dynamic array levels of the elements. To add only those elements that are on the same dynamic array level, use the SUM function. To add the elements of two dynamic arrays, use the ADDS function.

Examples

The following example uses the SUMMATION function to add the elements of a dynamic array:

a=10:@FM:9:@VM:8:@SM:7
PRINT SUMMATION(a);     ! returns 34

See Also

FeedbackOpens in a new tab