Excel functions / Logical
BYROW function
Runs a function on each row of an array and returns one result per row.
Syntax
=BYROW(array, lambda)
Arguments
array: The array to go through, a row at a time.lambda: A LAMBDA with one input, the row. A function name such as SUM also works.
When to use it
BYROW runs a LAMBDA on each row of a range and spills one result per row: the total, the largest, or any calculation of the row. It replaces a helper formula filled down beside a table.
Examples
The total of each row
A B C D E 1 Q1 Q2 Q3 2 10 20 30 60 3 40 50 60 150 In E2:
=BYROW(A2:C3, LAMBDA(row, SUM(row)))→ 60; 150The same with a function by name
A B C D E 1 Q1 Q2 Q3 2 10 20 30 30 3 40 50 60 60 In E2:
=BYROW(A2:C3, MAX)→ 30; 60
Common mistakes
- A result per cell. The LAMBDA must give one value for the row. For a result per cell, use MAP.