Support

Equilla Formula Language

SummationArray

Returns the sum of all or some elements in an array.

Inputs

Array
Array: The array containing the data to be summed up.
StartIndex
Numeric: The index of the first element.
EndIndex
Numeric: The index of the last element.

Examples

Sum of the last three elements
Variable: result; Array: myDynamicArray[]; FillArray(myDynamicArray, 3, 4, 5, 2, 7); result = SummationArray(myDynamicArray, 3, 5); print(result); // prints 14
Sum of the first four elements
Variable: result; Array: myDynamicArray[]; FillArray(myDynamicArray, 3, 4, 5, 2, 7); result = SummationArray(myDynamicArray, 4); print(result); // prints 14
Sum of all elements
Variable: result; Array: myDynamicArray[]; FillArray(myDynamicArray, 3, 4, 5, 2, 7); result = SummationArray(myDynamicArray); print(result); // prints 21