suml(List) or suml(List of list , x[index])

This function is designed to return the sum of a list of values or the sum of values located at specific indices within each sublist in the list.

suml(List) → number This function designed to calculate the sum of a list of numeric values or elements.

suml(List of list , x[index]) → number This function designed to calculate the sum of values located at specific indices within each sublist in the list.

Example:

<br><O N="sumlObject1" T="Project" Category="Functions" TransAlignRule="1"><br> <!-- created by ParamML Examples on 8/21/2023 --><br> <P N="List1" V="[0,1,2,3,4,5,6,7,8,9]" /><br> <P N="List2" V="[List1,List1]" /><br> <P N="sumList" V="suml(List1)" /><br> <P N="sumRangeList" V="suml(List2,x[3])" /><br></O><br>

As demonstrated, sumList returns the total of List1 while sumRangeList returns the sum of values at index 3 within each sublist of List2.

Last updated