/
sum (List, optional Startindex, optional endindex)

sum (List, optional Startindex, optional endindex)

This function is designed to return the sum of a list of values or the sum of a range in a list of values.

sum(List) → number

This function designed to calculate the sum of a list of numeric values or elements.

sum(List of list, start index, end index) → number

This function designed to calculate the sum of the values between given indices in a list of numeric values or elements.

Example:

<O N="sumObject1" T="Project" Category="Functions" TransAlignRule="1"> <!-- created by ParamML Examples on 8/22/2023 --> <P N="List1" V="[0,1,2,3,4,5,6,7,8,9]" /> <P N="sumList" V="sum(List1)" /> <P N="sumRangeList" V="sum(List1,5,6)" /> </O>
Debug Trace

 

As demonstrated, sumList returns the total of List1 while sumRangeList returns the sum of values between 5-6th indices of List1.

To view this example in the library, see (Engineering on Cloud )

 

 

Related content

suml(List) or suml(List of list , x[index])
suml(List) or suml(List of list , x[index])
More like this
length (List)
length (List)
More like this
avg (List)
avg (List)
More like this
getlistitem (List1, Index1, Index2) , List[Index1][Index2]
getlistitem (List1, Index1, Index2) , List[Index1][Index2]
More like this
minl (List, x, index, )
minl (List, x, index, )
More like this
map(Loop,x.parameter) or map(List,x.parameter)
map(Loop,x.parameter) or map(List,x.parameter)
More like this