SumByIndex

This function sums numbers at a given location within lists contained in a list.

Description

Given a list of lists and an index, sum the values at the given index in each list.

Type

NUMERIC

Arguments

Type

Meaning

1

LIST{LIST}

a list of lists.

2

NUMERIC

an index.

Evaluation

All values located at the given index in each list contained within the input list are summed, the total is returned.

Mathematical Expression

 

Comments

The input list must be non-empty.

The index must be positive and a legal index for each of the lists contained within the values list. For example, if the index value is 3, the sublists must each contain at least 4 items.

All items being summed must be numeric and have compatible dimensions.

If any of these conditions is not met, this function aborts the run with an error.

 
SumByIndex({true, 2.0 [cms]}, {false, 1.0 [cms]}, 1.0)
 
3.0 "cms"