The question "how the ISROW function is rebuilt" has no single universal answer because ISROW is not one standardized, cross-platform function: what it means, and therefore how it must be reimplemented, depends on which environment you are porting from—most commonly Microsoft Excel's ISROW worksheet function, or a same-named helper in a codebase or framework. In the Excel sense, ISROW(value) returns TRUE if value is a reference to a single entire row and FALSE otherwise, so "rebuilding" it means reproducing that reference-type test—not a lookup, not a range check, and not a numeric comparison—using whatever reference-inspection primitives your target language or engine provides.

What ISROW Actually Tests in Excel

Excel's ISROW belongs to the family of "IS" information functions that inspect what kind of thing an argument is rather than what it computes to. Its siblings include ISREF, ISCOL, and ISERR-type tests. The defining rule: ISROW is TRUE only when the argument is a reference to one complete row—for example a whole-row reference such as 5:5 or $A$7:$XFD$7 in the modern grid—and FALSE for a single cell, a multi-row block, a column reference, a literal value, or an expression that has already been evaluated to a value.

That last distinction is the heart of the matter and the usual source of confusion. Excel is unusual among spreadsheets in that some functions receive the reference itself as an argument rather than the dereferenced value. So =ISROW(5:5) is TRUE, but =ISROW(A1) is FALSE (a single cell, not a row), and =ISROW(SUM(5:5)) is FALSE because SUM(...) has already collapsed the reference into a number. If you naively test "does this range span a whole row," you will get the right answer for 5:5 and the wrong answer for SUM(5:5)—because by the time your code sees it, there is no reference left to inspect. Rebuilding ISROW faithfully therefore requires an architecture in which references can survive as first-class values up to the point of the test.

The modern Excel grid has 16,384 columns (A through XFD) and 1,048,576 rows. A whole-row reference is "complete" relative to the sheet's column dimension. A subtlety: Excel's ISROW treats a reference that spans an entire row as a row reference even when it is expressed with absolute markers or a sub-range that happens to cover all columns; a reference covering only some columns of one row is not a whole row and yields FALSE. Rebuilders must decide whether to model the full column extent as a fixed constant (16,384) or as a sheet property.

Rebuilding It: The General Algorithm

Stripped of vendor specifics, an ISROW rebuild has four stages, and getting any of them wrong changes the result:

1: Preserve reference identity. The parser/evaluator must carry an argument as a reference object (sheet, row span, column span, absolute/relative flags) rather than immediately resolving it to a scalar. If your language interns everything to values early, ISROW cannot be rebuilt; you would be rebuilding a different function. 2: Reject non-references. If the argument is a literal, a computed value, an array constant, or a function result, return FALSE. This is the identity check, and it is where most buggy clones fail. 3: Check the row dimension is exactly one row. A whole-row reference has a row span of exactly 1. A multi-row block (5:9) returns FALSE. A single cell also has a row span of 1 but a column span of 1, so a second test is required. 4: Check the column dimension equals the full sheet width. A single cell fails this; a whole row passes. Column-only references (A:A) fail the row-span test outright.

In pseudocode, the essential logic is:

Notice that steps 3 and 4 are both necessary and neither is sufficient. A single cell satisfies "one row" but not "full width"; a full-width multi-row block satisfies "full width" but not "one row." This is the cleanest way to explain the function to someone rebuilding it, and it also explains the most common wrong implementation: checking only the row count, which makes ISROW(A1) incorrectly TRUE.

Why "Rebuild" Is Ambiguous

The phrase "how the ISROW function is rebuilt" can mean at least three different engineering tasks, and the answer differs for each:

Reimplementing Excel semantics in another language (Python, JavaScript, a database engine). Here you control the parser and can keep references symbolic. The hard part is matching Excel's evaluation order—specifically that some functions get references and others get values—and matching edge cases like three-dimensional references across sheets. Reconstructing the function inside a spreadsheet-engine clone (LibreOffice Calc, Gnumeric, a web spreadsheet). These projects have their own row/column model and their own decision about whether ISROW exists and how it treats full-column constants. Behavior can diverge from Excel at the margins (e.g., how an out-of-grid or dynamic-array spill reference is classified), and a faithful rebuild must document those divergences rather than assume parity. Rebuilding a custom isRow-style helper in application code where it is not Excel's function at all but, say, a boolean predicate checking whether a value is a row of a matrix, a record of a result set, or a DOM row element. In that case "rebuild" means re-deriving the intended contract from tests and call sites, because the name is coincidental.

If you are porting between these senses, the first question to settle is whose ISROW you mean. Without that, a "rebuild" risks satisfying the wrong spec.

Rebuilding It in a Practical Implementation

Concretely, here is how you would rebuild the Excel-semantics version in a language that supports symbolic references. Represent a reference as a small record:

Your evaluator should have two argument-passing modes: by value (default) and by reference (opt-in for a whitelist of functions that includes ISROW, ISREF, ISCOL, ROW, COLUMN, and address/offset builders). When dispatching ISROW, hand it the unresolved Ref. Then:

Three practical cautions when rebuilding:

Do not equate "one row tall" with "is a row." As shown, a cell is one row tall. This is the single most common correctness bug, and a good test suite will catch it with ISROW(A1) expecting FALSE. Handle the value-vs-reference boundary explicitly. ISROW(SUM(5:5)) must be FALSE. If your evaluator is eager, wrap computed arguments in a Value node distinct from Ref so the type discrimination is trivial rather than heuristic. Decide on dynamic arrays and spills. In modern Excel, a spilled range reference and a whole-row reference are different animals; a spill of one row and many columns is not a whole row. Rebuilders should classify spilled results as values/arrays, not as whole-row references, unless the source engine's documentation says otherwise.

Where the Rebuild Stops Applying and What Causes Confusion

The rebuild described above is faithful only to the reference-classification contract. It does not reproduce Excel's recalculation behavior, its treatment of references on other sheets, or the interaction with structured table references (Table1[#All] and similar), which are not whole-row grid references and may be classified differently depending on the engine and version. Older Excel editions and some compatibility modes have different visible grid extents and different function availability; a rebuild pinned to 16,384 columns is wrong for an engine whose sheets are narrower, so parameterize the width rather than hard-code the Excel constant. Finally, ISROW is sometimes confused with "is this a row index" or "is this within row bounds"—neither is what the function tests, and rebuilding the wrong intent produces a function that passes casual tests but fails the identity distinction that makes ISROW useful in the first place.

The short version: rebuilding ISROW is a small function wrapped around a large architectural requirement—keep references symbolic long enough to inspect them, then require exactly one row and the full sheet width. Get the reference-preservation right and the body is four lines; get it wrong and no amount of checking can recover the information the function needs.