BYROW Function

Excel Functions › Logical

Excel 365

The Excel BYROW function hands each entire row of a range to a LAMBDA and spills back one result per row. It is the one-formula replacement for a totals column you’d otherwise drag down: SUM each row, MAX each row, or any custom per-row verdict. Its twin BYCOL does the same thing column by column.


Quick answer: to get each region’s best quarter from a 4×4 grid in B2:E5:
=BYROW(B2:E5, LAMBDA(r, MAX(r)))
The LAMBDA’s parameter r receives a whole row (four cells at once), so aggregation functions like MAX, SUM, and AVERAGE are exactly what belongs inside.

Syntax

=BYROW(array, lambda(row))
ArgumentDescription
arrayRequiredThe range or array to process row by row.
lambdaRequiredA one-parameter LAMBDA. The parameter receives one complete row as a horizontal vector — not a single cell — and the body must boil it down to a single value.

Available in: Excel for Microsoft 365 and Excel for the web only. Older versions show #NAME?. The output is a one-column array with exactly one value per input row.

One result per row, no fill handle

Quarterly sales sit in B2:E5, one row per region. A single formula in F2 returns each region’s best quarter:

ABCDEF
1RegionQ1Q2Q3Q4Best quarter
2North410520480610610
3South380290350400400
4East510545530490545
5West300360420455455
=BYROW(B2:E5, LAMBDA(r, MAX(r))) // spills 4 results into F2:F5

Inside the LAMBDA, r is the whole row — B2:E2 on the first pass, B3:E3 on the second, and so on. Anything that aggregates a range works on it:

=BYROW(B2:E5, LAMBDA(r, SUM(r))) // row totals
=BYROW(B2:E5, LAMBDA(r, AVERAGE(r))) // row averages
=BYROW(B2:E5, LAMBDA(r, COUNTIF(r, ">500"))) // quarters above target, per region

Try it: aggregate each row live

Live demo

Choose what the LAMBDA does to each row and watch the spilled column update.

Per-row logic and dynamic-array combos

The LAMBDA body can be any expression that returns one value — including conditional verdicts per row:

=BYROW(B2:E5, LAMBDA(r, IF(SUM(r)>=1800, "Bonus", "—"))) // a per-region flag

Pair BYROW with other dynamic arrays. Rank regions by their totals without any helper column:

=SORTBY(A2:A5, BYROW(B2:E5, LAMBDA(r, SUM(r))), -1) // region names, biggest total first

Or filter a table to rows whose own values pass a test:

=FILTER(A2:E5, BYROW(B2:E5, LAMBDA(r, MIN(r)>=300))) // regions that never dipped below 300

Family map: element-by-element transforms are MAP’s job; per-column results are BYCOL; folding the whole array to one value is REDUCE; generating a grid from scratch is MAKEARRAY.

Errors & common pitfalls

#CALC! — the LAMBDA returns an array, not a single value. Each row must collapse to exactly one result. LAMBDA(r, r*2) returns a whole row of values per row — BYROW can’t place it. If you meant to transform every cell, use MAP.

#CALC! — wrong parameter count. BYROW’s LAMBDA takes exactly one parameter (the row vector). Declaring two, or none, fails.

#NAME? — older Excel. BYROW exists only in Excel for Microsoft 365 and Excel for the web. Excel 2021 and earlier don’t recognize it.

Pitfall: thinking the parameter is one cell. Unlike MAP, the parameter is the entire row. LAMBDA(r, IF(r>100, …)) compares a whole vector and misbehaves — wrap the row in an aggregate first: IF(SUM(r)>100, …).

Pitfall: #SPILL! below the formula. BYROW returns one value per input row — those cells must be empty.

Practice workbook

📊
Download the free BYROW practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What does the Excel BYROW function do?
BYROW runs a LAMBDA once per row of a range, passing the whole row in as a vector, and spills a single column with one result per row — row totals, row maximums, or any custom per-row calculation.
What's the difference between BYROW and MAP?
What the LAMBDA receives. MAP passes one element (cell value) at a time and returns a same-size array; BYROW passes one whole row at a time and returns one value per row. Transform cells = MAP; aggregate rows = BYROW.
Why does BYROW return #CALC!?
Most often the LAMBDA body returns an array instead of a single value (e.g. r*2), or the LAMBDA doesn't declare exactly one parameter. Each row must reduce to one result — wrap the row in SUM, MAX, TEXTJOIN, or similar.
Can I use BYROW to sum each row of a table?
Yes — that's its signature move: =BYROW(B2:E100, LAMBDA(r, SUM(r))) spills 99 row totals from one formula. The classic alternative was typing =SUM(B2:E2) and dragging it down.
Which Excel versions support BYROW?
Excel for Microsoft 365 and Excel for the web only. Excel 2021 and earlier show #NAME?; there the drag-down helper column is the fallback.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: BYCOL · LAMBDA · MAP · REDUCE · MAKEARRAY · SCAN · FILTER