
Return the row number of a cell or range reference. ROW is useful for numbering, relative offsets, and formulas that need to know their vertical position.
The ROW function returns the row number of a reference. If the reference is in row 10, the result is 10. If you leave the reference out, ROW returns the row number of the cell that contains the formula.
That simple behavior makes ROW useful in many worksheet patterns. It can generate running numbers, build relative offsets, create moving lookup indexes, and help formulas react to their position in the sheet.
Useful when a formula needs to know its vertical position or the row of another reference.
Returns a positive whole number such as 1, 25, or 500. In newer Excel versions, a range can return multiple row numbers.
=ROW([reference])
The reference is optional. If you write =ROW(B500), the result is 500. If you write =ROW() in cell D7, the result is 7 because the formula is sitting in row 7.
In current Excel versions, a range such as A1:A3 can return multiple row numbers as an array. In many everyday worksheets, though, ROW is used with a single cell or with no argument at all.
If you omit the reference, ROW uses the location of the formula itself. If you give it a reference, the function uses that reference instead. This is why ROW()-1 is a common numbering pattern: the formula takes its own row number and then shifts it by a fixed amount.
The reference does not have to point to a cell with data in it. ROW only cares about position, not cell contents. That means ROW(B500) still returns 500 even if B500 is empty.
ROW is about position. Related functions answer slightly different questions.
| Function | Main Question | Returns | Use When |
|---|---|---|---|
ROW |
Which row is this? | Position number | You need a row index or row-based offset |
ROWS |
How many rows are in this range? | Count | You need the size of a range, not its position |
COLUMN |
Which column is this? | Position number | You need the horizontal position instead of the vertical one |
SEQUENCE |
Can Excel generate a list of numbers? | Array | You want a full list of numbers rather than one row position at a time |
One of the most common uses of ROW is automatic numbering. Instead of typing 1, 2, 3 by hand, a sheet can use ROW() or an adjusted version like ROW()-1. Because the number comes from the row position, it updates automatically when the sheet structure changes.
ROW is also useful inside other formulas. For example, it can provide a moving index to a lookup formula as the formula is copied downward. This is an older but still practical technique for building multi-row retrieval patterns without rewriting the index by hand.
Another useful pattern is row distance. When you subtract one ROW result from another, you get the gap between two positions. That can help with section-based logic, offset calculations, or checks that depend on how far a record is from a starting point.
This is the simplest version of the function. If the formula is in row 5, ROW returns 5. The result depends on where the formula is placed, which is why this pattern is useful for automatic numbering.
=ROW() // Returns 5 if entered in row 5
Return the row number of the cell containing the formula. Formula: =ROW().
This version ignores the formula's own location and returns the row number of the reference you give it. ROW(B500) always returns 500, so it is useful when a formula needs the position of another cell rather than its own row.
=ROW(B500) // Returns 500
Return the row number of cell B500. Formula: =ROW(B500).
If your data starts in row 2, =ROW()-1 returns 1 in the first data row, 2 in the next one, and so on. This is a common way to build simple IDs that follow the sheet structure automatically.
=ROW()-1 // Returns 1 in row 2, 2 in row 3, and so on
Starting in row 2, create the value 1 by subtracting 1 from the current row. Formula: =ROW()-1.
Subtracting ROW(A1) from ROW(A150) returns 149. This is useful when the sheet needs a relative offset instead of the original row numbers themselves.
=ROW(A150)-ROW(A1) // Returns 149
Find the row difference between A150 and A1. Formula: =ROW(A150)-ROW(A1).
Tell your friends about this post