{
  "category": "Logical functions",
  "display_name": "BYROW",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.BYROW",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 27 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 27 recorded answers",
    "workbook_corpus": {
      "cells": 27,
      "matched": 27
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/lambda_helpers.rs#L452-L452",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/lambda_helpers.rs#L232-L238"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/lambda_helpers::prepared",
        "catalogue/lambda_helpers::lambda",
        "catalogue/lambda_helpers::item",
        "catalogue/lambda_helpers::cell",
        "catalogue/lambda_helpers::array",
        "catalogue/lambda_helpers::by_task",
        "catalogue/lambda_helpers::helper",
        "catalogue/lambda_helpers::HelperTask::advance",
        "catalogue/lambda_helpers::run"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/lambda_helpers.rs#L452-L452",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 27 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.BYROW.json",
  "name": "BYROW",
  "notes": [
    {
      "basis": "27 recorded readings in dynamic-array Excel, each with size observers.",
      "documentation": null,
      "evidence": [
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "scalar_errors_keep_their_array_argument_origins",
          "note": "recorded readings pinned",
          "path": "apps/dna-onecalc/tests/acceptance.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "sheets fn2_q001 to fn2_q007, fn2_q031 to fn2_q042, fn2_q232 to fn2_q239",
          "note": "recorded readings",
          "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.BYCOL",
        "FUNC.BYROW",
        "FUNC.EXPAND",
        "FUNC.HSTACK",
        "FUNC.MAP",
        "FUNC.TAKE",
        "FUNC.TOCOL",
        "FUNC.TOROW",
        "FUNC.VSTACK"
      ],
      "inferred": null,
      "kind": "quirk",
      "note_id": "FN-HSTACK-001",
      "open": [
        "Competing errors in later positions have not been read in a published capture."
      ],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "=HSTACK(1,#VALUE!)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#VALUE!",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q004, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=TAKE(#N/A,0)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q232, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MAP(NA(),LAMBDA(xx,IFERROR(xx,3)))",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q031, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MAP({#N/A},LAMBDA(xx,3))",
          "correct": null,
          "excel": {
            "bits": "0x4008000000000000",
            "display": "3",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q032, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=HSTACK(Data!C1,{1;2})",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "{#N/A,1;#N/A,2}",
            "kind": "array"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "Data!C1",
              "value": {
                "bits": null,
                "display": "#N/A",
                "kind": "error"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q238, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=TOCOL(#N/A,2)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q233, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=TOCOL({#N/A},2)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#CALC!",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q234, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=EXPAND(Data!C1,2,2,\"pad\")",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "Data!C1",
              "value": {
                "bits": null,
                "display": "#N/A",
                "kind": "error"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q237, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=BYROW(#N/A,#VALUE!)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q040, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=BYROW({#N/A},2)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#VALUE!",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet fn2_q038, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn2_questions/oracle.capture.json",
            "repository": "DnaCalc"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "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!.",
      "status": "measured",
      "title": "A direct error stops these array functions; the same error in an array or cell is an element"
    }
  ],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[BYCOL](FUNC.BYCOL.md) passes whole columns. [MAP](FUNC.MAP.md) passes individual positions and\npreserves shape. [REDUCE](FUNC.REDUCE.md) accumulates over the array rather than producing one\nanswer per row.\n\n\n\n\n",
    "how-to-implement": "\nExpose one row-shaped view of the input at a time, invoke the one-parameter callable, and store\nits scalar answer in the corresponding position of a one-column result. Preserve the callable\nand any references the operation requires instead of reconstructing them from cell display.\n\nValidate result shape per invocation. Do not flatten a nested result silently or reduce a\nreturned error into a logical. Keep direct argument error handling separate from errors found\ninside a row. Share this machinery with BYCOL by changing which dimension is exposed and which\noutput dimension is retained.\n\n\n",
    "quirks": "\nMicrosoft documents incorrect lambda parameters as `#VALUE!` and a result that is not a single\nvalue as `#CALC!`. A row-shaped input to the lambda does not mean that the lambda may return an\narbitrarily shaped array.\n\nDirect error arguments are checked before ordinary array elements. The recorded\n`BYROW(#N/A,#VALUE!)` returns `#N/A`, while `BYROW({#N/A},2)` returns `#VALUE!` for the invalid\nlambda. Keep those cases distinct when validating a helper call.\n\n\n",
    "sources": "\n- [Microsoft: BYROW function](https://support.microsoft.com/en-us/excel/functions/byrow-function).\n- [Recorded helper error examples](../notes/FN-HSTACK-001.json).\n\n",
    "try-it": "\nChange the sum to `MAX(row)` or `AVERAGE(row)`. Compare the output shape with BYCOL, which\npasses columns instead and returns a row.\n\n\n",
    "version-differences": "\nMicrosoft lists BYROW for Microsoft 365 and Excel 2024 on Windows and Mac. The error examples\nbelow are observations on their named build, not a cross-version comparison.\n\n\n",
    "what-it-does": "\n`BYROW(array, lambda)` applies a one-parameter lambda to each entire row and returns one result\nper row in a single column. For `r` input rows and `c` input columns, a scalar result from each\ninvocation produces an `r`-by-one output.\n\n`=BYROW({1,2;3,4},LAMBDA(row,SUM(row)))` returns the column `{3;7}`. The lambda receives a row\narray, not one cell at a time.\n\n\n"
  },
  "signature": {
    "display": "BYROW(array, lambda)",
    "parameters": [
      {
        "description": null,
        "name": "array",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "lambda",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 2,
        "min": 2
      },
      "category": "Logical functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "ReductionFold",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "One result per row, from a LAMBDA called on each row",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Applies a LAMBDA to each row and returns an array of the results",
        "microsoft_url": "https://support.microsoft.com/en-us/office/byrow-function-2e04c677-78c8-4e6b-8c10-a4602f2602bb"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "BYROW"
        },
        {
          "locale": "bg-BG",
          "name": "BYROW"
        },
        {
          "locale": "cs-CZ",
          "name": "BYROW"
        },
        {
          "locale": "da-DK",
          "name": "BYROW"
        },
        {
          "locale": "de-DE",
          "name": "BYROW"
        },
        {
          "locale": "el-GR",
          "name": "BYROW"
        },
        {
          "locale": "en-AU",
          "name": "BYROW"
        },
        {
          "locale": "en-GB",
          "name": "BYROW"
        },
        {
          "locale": "en-US",
          "name": "BYROW"
        },
        {
          "locale": "es-ES",
          "name": "BYROW"
        },
        {
          "locale": "et-EE",
          "name": "BYROW"
        },
        {
          "locale": "fi-FI",
          "name": "BYROW"
        },
        {
          "locale": "fr-FR",
          "name": "BYROW*"
        },
        {
          "locale": "he-IL",
          "name": "BYROW"
        },
        {
          "locale": "hr-HR",
          "name": "BYROW"
        },
        {
          "locale": "hu-HU",
          "name": "BYROW"
        },
        {
          "locale": "id-ID",
          "name": "BYROW"
        },
        {
          "locale": "it-IT",
          "name": "BYROW"
        },
        {
          "locale": "ja-JP",
          "name": "BYROW"
        },
        {
          "locale": "ko-KR",
          "name": "BYROW"
        },
        {
          "locale": "lt-LT",
          "name": "BYROW"
        },
        {
          "locale": "lv-LV",
          "name": "BYROW"
        },
        {
          "locale": "nb-NO",
          "name": "ETTERRAD"
        },
        {
          "locale": "nl-NL",
          "name": "BYROW"
        },
        {
          "locale": "pl-PL",
          "name": "WIERSZAMI"
        },
        {
          "locale": "pt-BR",
          "name": "BYROW"
        },
        {
          "locale": "pt-PT",
          "name": "BYROW"
        },
        {
          "locale": "ro-RO",
          "name": "BYROW"
        },
        {
          "locale": "ru-RU",
          "name": "BYROW"
        },
        {
          "locale": "sk-SK",
          "name": "BYROW"
        },
        {
          "locale": "sl-SI",
          "name": "BYROW"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "BYROW"
        },
        {
          "locale": "sv-SE",
          "name": "BYROW"
        },
        {
          "locale": "th-TH",
          "name": "BYROW"
        },
        {
          "locale": "tr-TR",
          "name": "BYROW"
        },
        {
          "locale": "uk-UA",
          "name": "BYROW"
        },
        {
          "locale": "vi-VN",
          "name": "BYROW"
        },
        {
          "locale": "zh-CN",
          "name": "BYROW"
        },
        {
          "locale": "zh-HK",
          "name": "BYROW"
        },
        {
          "locale": "zh-TW",
          "name": "BYROW"
        }
      ],
      "signature": {
        "display": "BYROW(array, lambda)",
        "parameters": [
          {
            "description": null,
            "name": "array",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "lambda",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "BYROW",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": "https://support.microsoft.com/en-us/office/byrow-function-2e04c677-78c8-4e6b-8c10-a4602f2602bb"
  },
  "try_it": {
    "formula": "=BYROW({1,2;3,4},LAMBDA(r,SUM(r)))"
  },
  "url": "https://handbook.dnacalc.com/functions/BYROW.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "=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.",
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "=BYROW(#N/A,#VALUE!)",
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA"
        },
        {
          "call": "=BYROW({#N/A},2)",
          "excel": {
            "bits": null,
            "display": "#VALUE!",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA"
        }
      ],
      "platform": "Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/3345a87/content/notes/FN-HSTACK-001.json"
      ]
    }
  ]
}