Back to functions
Logical2026-11-221 related article

BYROW Function in Excel

Apply a calculation to each row of an array and return one result per row.

Syntax

BYROW(array, lambda(row))
Table of Contents

Arguments

array

Required

Input array to process by row.

lambda

Required

Callback with one parameter representing the current row; must return a single result.

What it returns

One result per input row in a single output column.

What BYROW does

BYROW passes each row of a range to a LAMBDA calculation and returns one result for that row. A range with four rows produces four results in a single output column.

For example, you can total each person's monthly figures with one formula. The results spill into the cells below the formula, so you don't need to copy it down.

Practical examples

Total each person's monthly figures

Enter this table in A1:D5. Leave C4 genuinely empty; enter note as text in B5.

PersonJanFebMar
Ada12010080
Ben9080110
Cara10050
Dannote4010

In F2, with F2:F5 clear, enter:

=BYROW(B2:D5,LAMBDA(values,SUM(values)))
Formula

The expected results spill down F2:F5:

CellRow total
F2300
F3280
F4150
F550

values receives one row at a time. SUM adds that row's numbers, ignoring the referenced blank and text cells. Cara's total is 100 + 50 = 150; Dan's is 40 + 10 = 50.

Add two amounts per record

On a separate worksheet, enter this small range in B2:C3:

BC
1020
3040

In E2, enter:

=BYROW(B2:C3,LAMBDA(values,SUM(values)))
Formula

The expected results are 30 in E2 and 70 in E3. The first row returns 10 + 20, and the second returns 30 + 40. You get two row totals rather than one total for the whole range.

The row and column totals guide also shows how an Excel Table can supply a growing input range.

Common mistakes and notes

Return one value from each row

The LAMBDA declares one input parameter, values, followed by its calculation. SUM(values) is the calculation, not a second parameter. An invalid LAMBDA or incorrect parameter count returns #VALUE! (Incorrect Parameters).

Each row must produce a single value. A calculation that returns several values for a row produces #CALC!; Microsoft also documents this error when the required LAMBDA is missing.

Leave room below the formula

A blocked output cell causes #SPILL!. Keep the formula outside an Excel Table, with enough empty cells below for every input row. You can use a Table column range as the input while placing the formula outside the Table.

A fixed range stays fixed

The example uses B2:D5. Adding a record in row 6 doesn't automatically add it to that reference. Extend the input range or use a structured Table reference when records will be added.

The calculation decides how text and errors behave

SUM ignores text and blank cells in the referenced rows, so a completely blank row returns 0. That doesn't mean BYROW ignores every kind of input: a source error still reaches the SUM result for its row. Other LAMBDA calculations may handle text differently.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use BYROW.

Official documentation