ROW Function
Tells you which row number a cell sits in.
Category
Lookup & Reference
Available in
All versions, Microsoft 365
Returns
A row number
Overview
ROW returns the row number of a reference. =ROW(C7) returns 7. Leave the reference out and you get the row of the formula's own cell.
It's commonly used to build running numbers and to convert sheet positions into list positions.
Syntax
=ROW([reference])
Arguments
| Argument | Required? | What it does |
|---|---|---|
| reference | Optional | The cell or range to check. If left out, the formula's own cell is used. |
Examples
Example 1 — Auto-numbering a list
Number each row starting at 1, even though the data starts in row 2.
A2fx=ROW()-1
| A | B | |
|---|---|---|
| 1 | # | Item |
| 2 | 1 | Pens |
| 3 | 2 | Pads |
| 4 | 3 | Ink |
=ROW()-1 Explain
Example 2 — Shading every other row
In Conditional Formatting, use this formula rule to band rows.
=MOD(ROW(), 2) = 0 Explain
Numbers from ROW()-1 survive sorting better if you use =SEQUENCE(COUNTA(B2:B100)) instead.
Common mistakes
- Numbers shift when rows move. ROW reflects the current position — sorting or deleting rows changes the results.
Notes
- Given a range in Microsoft 365, ROW spills one number per row.
- Related functions: ROWS, COLUMN, SEQUENCE.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.