Logical functions

BYROW

Matches all 27 recorded answers

Recorded: 27 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicBYROW
BulgarianBYROW
CzechBYROW
DanishBYROW
GermanBYROW
GreekBYROW
English (Australia)BYROW
English (United Kingdom)BYROW
English (United States)BYROW
SpanishBYROW
EstonianBYROW
FinnishBYROW
FrenchBYROW
HebrewBYROW
CroatianBYROW
HungarianBYROW
IndonesianBYROW
ItalianBYROW
JapaneseBYROW
KoreanBYROW
LithuanianBYROW
LatvianBYROW
NorwegianETTERRAD
DutchBYROW
PolishWIERSZAMI
Portuguese (Brazil)BYROW
Portuguese (Portugal)BYROW
RomanianBYROW
RussianBYROW
SlovakBYROW
SlovenianBYROW
Serbian (Latin)BYROW
SwedishBYROW
ThaiBYROW
TurkishBYROW
UkrainianBYROW
VietnameseBYROW
Chinese (Simplified)BYROW
Chinese (Hong Kong)BYROW
Chinese (Traditional)BYROW

Names from Microsoft's support site.

What it does

BYROW(array, lambda)

BYROW(array, lambda) applies a one-parameter lambda to each entire row and returns one result per row in a single column. For r input rows and c input columns, a scalar result from each invocation produces an r-by-one output.

=BYROW({1,2;3,4},LAMBDA(row,SUM(row))) returns the column {3;7}. The lambda receives a row array, not one cell at a time.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Change the sum to MAX(row) or AVERAGE(row). Compare the output shape with BYCOL, which passes columns instead and returns a row.

Quirks

Microsoft documents incorrect lambda parameters as #VALUE! and a result that is not a single value as #CALC!. A row-shaped input to the lambda does not mean that the lambda may return an arbitrarily shaped array.

Direct error arguments are checked before ordinary array elements. The recorded BYROW(#N/A,#VALUE!) returns #N/A, while BYROW({#N/A},2) returns #VALUE! for the invalid lambda. Keep those cases distinct when validating a helper call.

A direct error stops these array functions; the same error in an array or cell is an element

An error written directly as an argument of these functions is the answer for the whole call. It is not placed in the result: HSTACK(1,#VALUE!) is #VALUE!, not a row holding 1 and an error, and TAKE(#N/A,0) is #N/A. With MAP the LAMBDA does not run at all: MAP(NA(),LAMBDA(xx,IFERROR(xx,3))) is #N/A. The same error inside an array, or in a referenced cell, is an ordinary element: MAP({#N/A},LAMBDA(xx,3)) is 3, and HSTACK(Data!C1,{1;2}) with #N/A in Data!C1 is a 2 by 2 array with #N/A in its first column. TOCOL and TOROW show the difference with ignore 2: TOCOL(#N/A,2) is #N/A, while TOCOL({#N/A},2) drops the error, has nothing left, and is #CALC!. EXPAND is an exception on the cell side: EXPAND(Data!C1,2,2,"pad") is #N/A for the whole call. BYROW and BYCOL check the direct error first too: BYROW(#N/A,#VALUE!) is #N/A, while BYROW({#N/A},2), where 2 is not a LAMBDA, is #VALUE!.

FormulaExcelMathematical value
=HSTACK(1,#VALUE!)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#VALUE!—
=TAKE(#N/A,0)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#N/A—
=MAP(NA(),LAMBDA(xx,IFERROR(xx,3)))
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#N/A—
=MAP({#N/A},LAMBDA(xx,3))
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

3
0x4008000000000000
—
=HSTACK(Data!C1,{1;2})
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Number supplied through a cell.

Data!C1: #N/A

{#N/A,1;#N/A,2}—
=TOCOL(#N/A,2)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#N/A—
=TOCOL({#N/A},2)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#CALC!—
=EXPAND(Data!C1,2,2,"pad")
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Number supplied through a cell.

Data!C1: #N/A

#N/A—
=BYROW(#N/A,#VALUE!)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#N/A—
=BYROW({#N/A},2)
Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
Inputs and reference value

Typed formula.

#VALUE!—

Inputs, build details and evidence

How to implement

Expose one row-shaped view of the input at a time, invoke the one-parameter callable, and store its scalar answer in the corresponding position of a one-column result. Preserve the callable and any references the operation requires instead of reconstructing them from cell display.

Validate result shape per invocation. Do not flatten a nested result silently or reduce a returned error into a logical. Keep direct argument error handling separate from errors found inside a row. Share this machinery with BYCOL by changing which dimension is exposed and which output dimension is retained.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

BYROW · 1 lines · calc-func/src/catalogue/lambda_helpers.rs on GitHub
4 byrow_fn "BYROW" (2, 2) [R "array", R "lambda"] resume byrow_resume => byrow_start; |s, a, sv| { run(s, byrow_start(s, a, sv), sv) }
byrow_start · 7 lines · calc-func/src/catalogue/lambda_helpers.rs on GitHub
fn byrow_start(
    site: &Site<'_>,
    a: &[CalcValue],
    sv: &mut EvalServices<'_>,
) -> Step<Box<dyn KernelTask>> {
    by_task(site, a, sv, false)
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

Microsoft lists BYROW for Microsoft 365 and Excel 2024 on Windows and Mac. The error examples below are observations on their named build, not a cross-version comparison.

Excel 16.0.20527.20088

Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA

=BYROW(#N/A,#VALUE!) returned #N/A. =BYROW({#N/A},2) returned #VALUE!. Inputs were supplied through formula literals. These are controls from this environment, not a same-input comparison with another build.

Observed formulas and results
  • =BYROW(#N/A,#VALUE!) → #N/A (formula-literal)
  • =BYROW({#N/A},2) → #VALUE! (formula-literal)

Alternatives

BYCOL passes whole columns. MAP passes individual positions and preserves shape. REDUCE accumulates over the array rather than producing one answer per row.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents