Contact

ROW in Excel: Worksheet Positions and Relative Record Numbers

Lookup Intermediate Microsoft Excel

Return worksheet row numbers with Excel ROW, build relative position counters, and distinguish a physical row from a stable record identifier.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: ROW returns a worksheet row number. With a single-cell reference it identifies that cell; without a reference it identifies the cell containing the formula.

Availability and version history

  • Introduced: Original introduction release not established by the official history reviewed.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official ROW reference. Documentation check; examples independently calculated, not native-tested.

Syntax and omitted-reference behavior

=ROW([reference])

The reference is optional. A reference to C12 returns row number 12 even if the formula is entered elsewhere. With no reference, the formula uses its own location. Microsoft also documents array results for a vertical range, and excludes multiple-area references. Official ROW reference

ROW describes a worksheet position. It does not read the number stored in the referenced cell or count the records above that cell.

Example 1: separate location from contents

Put the number 900 in C12. In F2 enter:

=ROW(C12)

Expected result: 12, not 900. Clear C12 and the result remains 12 because the reference still points to the same worksheet row.

Now put this formula directly in F8:

=ROW()

Expected result: 8. The output depends on the formula’s own row because no argument was supplied. Entering the same formula in F9 gives 9.

Example 2: number records relative to a starting row

Enter Pen, Pad, Box and Tape in A5:A8. In B5 use:

=ROW(A5)-ROW($A$5)+1

Fill down through B8. Expected results are 1, 2, 3, 4. The fixed starting reference remains row 5, while the first reference advances as the formula is filled down.

The first record gets 5−5+1=1. Omitting the final +1 would make the sequence begin at zero. That may be valid in some calculations, but it is not the intended one-based record numbering here.

Example 3: find alternating worksheet rows

In D5 enter and fill down through D8:

=MOD(ROW(),2)=0

Expected Boolean results are FALSE, TRUE, FALSE, TRUE, corresponding to worksheet rows 5–8. This tests even worksheet row numbers, not alternating nonblank records. A blank source row would still have a physical position.

The same idea can support a formatting rule, but this example only calculates the Boolean values. Applying formatting is a separate workbook action.

Advanced example: return a sequence of row coordinates

In dynamic-array Excel, enter this in F12 with F12:F15 clear:

=ROW(A5:A8)

Expected vertical output: 5, 6, 7, 8. These are worksheet coordinates, whereas the relative-counter example returned 1–4.

The official reference describes the vertical-array form. Older Excel uses legacy array-entry workflows, so ordinary single-cell entry in a legacy workbook should not be assumed to produce the same spill. For a scalar-only portable check, use a single-cell reference such as ROW(A5) and fill it down.

Why row numbers are not permanent IDs

A row-based counter follows a sheet layout. Sorting the underlying records, inserting rows, or moving formulas can change which record receives which visible number. That may be desirable for a current display position but unsuitable for an order number that must never change.

Store persistent identifiers as actual data, or use a controlled ID-generation process appropriate to the workbook. Do not export a temporary ROW-based sequence and later assume it remains a stable join key after the source has been reorganized.

Troubleshooting

If a result differs by a constant amount, inspect the starting reference and the final +1. If every copied result stays the same, check whether both references were accidentally made absolute. If a multi-cell formula behaves differently in an older file, inspect array-entry and implicit-intersection behavior before changing the row arithmetic.

To measure how many rows a range spans, use ROWS rather than ROW. For example, A5:A8 has four rows even though its last worksheet row number is eight.

Verification: These are fictional inputs and independently calculated expected results, not native Excel observations. See the editorial testing standards.