Sum

Returns the sum of the non-null elements of a given set of numbers.

Syntax

Sum(n1 [, n2 ...])

Parameters

Parameter

Description

n1

A numeric value or expression.

n2 (optional)

Additional numeric values and/or expressions.

Note: FormCalc follows the IEEE-754 international standard when handling floating point numeric values. For more information, see Number literals.

Examples

The following expressions are examples of using the Sum function:

Expression

Returns

Sum(2, 4, 6, 8)

20

Sum(-2, 4, -6, 8)

4

Sum(4, 16, "abc", 19)

39

Sum(Amount[2], Amount[5])

Totals the third and sixth occurrences of Amount.

Sum(Round(20/3, 2), Max(Amount[*]), Min(Amount[*]))

Totals the value of 20/3 rounded to two decimal places, as well as the largest and smallest non-null occurrences of Amount.

See also Max, Min, and Round.

// Ethnio survey code removed