LAMBDA: SumRowsλ
Description
Returns a an array of totals by row in a two dimensional array.
There are many situations where we have numbers in an array that need to be totaled by row. In the simple example above, we are totaling each tasks costs.
Syntax
We see this LAMBDA being use in the GIF.:
=SumRowsλ( <Array> )
Where:
Array - is a two dimensional array of values
Code
This is the code as of this writing. This is a good example of how to use BYROW. For the most current version, see the Gist.
/*
FUNCTION NAME: SumRowsλ
DESCRIPTION: Returns a vector array of totals by row over a two dimensional array
EXAMPLE: =SumRowsλ(daCalcs)
ARGS:
Array A two dimensional array of values
GUILTY PARTIES: Various Others 2022
*/
SumRowsλ = LAMBDA(
// Parameter Declarations
Array,
// Function starts here
BYROW(
Array,
LAMBDA(Row, SUM(Row))
)
);
Importing
Use the Advance Formula Environment add-in available (free) from the Microsoft store (use Developer tab > Add-ins icon > This LAMBDA is available for download. Click Advanced Formula Environment to learn more about that.
All of my LAMBDAs can be found here: https://gist.github.com/CHatmaker.
This specific LAMBDA is part of a Dates library at this URL:
https://gist.github.com/CHatmaker/3e1708888ec2bd1cde2ec9d002dc459b