# ROW function in Excel

> ROW returns the row number of a cell: ROW(C7) is 7, and ROW() with nothing inside returns the row of the cell the formula sits in.

Source: https://spreadsheetpractice.com/functions/row · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** ROW returns the row number of a cell: ROW(C7) is 7, and ROW() with nothing inside returns the row of the cell the formula sits in.
- **Syntax:** `=ROW([reference])`
- **Most common use:** `=ROW()` returns 2 (The row of the formula's own cell)
- **Available in:** Every current version
- **Category:** [Lookup functions](https://spreadsheetpractice.com/functions/category/lookup)
- **Returns:** A row number. Given a range of several rows, Microsoft 365 returns each row number as a spilled list.
- **Google Sheets:** Works the same way in Google Sheets.

## What it does

ROW returns the row number of a cell: ROW(C7) is 7, and ROW() with nothing inside returns the row of the cell the formula sits in. It numbers lists automatically, turns position into a count inside other formulas, and drives rules such as shading every other row.

## Syntax

`=ROW([reference])`

| Argument | Required? | What it is |
|---|---|---|
| `reference` | Optional | The cell to get the row number of. Leave it out to use the formula's own cell. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | `=ROW()` | 2 | The row of the formula's own cell |
| D3 | `=ROW(A5)` | 5 | The row of the cell you point to |
| D4 | `=ROW()-ROW($A$1)` | 3 | Numbers rows from 1 under the header: this is the third item |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D |
|---|---|---|---|---|
| 1 | Item | Qty |  | Result |
| 2 | Bolts | 150 |  | 2 |
| 3 | Nuts | 150 |  | 5 |
| 4 | Washers | 300 |  | 3 |
| 5 | Brackets | 40 |  |  |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| Numbers shift when rows are inserted above | =ROW()-1 assumes the list starts in row 2. Subtract the header's row instead, =ROW()-ROW($A$1), so the numbering follows the table. |
| Mixing up ROW and ROWS | ROW returns a row number. ROWS counts the rows in a range. |

## Tips

- =MOD(ROW(),2)=0 as a conditional formatting rule shades every other row.
- In Excel 2021 or later, =SEQUENCE(10) numbers a list in one formula without filling down.

## Related functions

- [ROWS](https://spreadsheetpractice.com/functions/rows): ROWS counts how many rows a range or array has, whether or not the cells contain anything.
- [COLUMN](https://spreadsheetpractice.com/functions/column): COLUMN returns the column number of a cell: COLUMN(D1) is 4, and COLUMN() with nothing inside returns the column of the formula's own cell.
- [SEQUENCE](https://spreadsheetpractice.com/functions/sequence): SEQUENCE generates a list or grid of numbers from one formula: 1 to 10, every fifth number, or a countdown.

## Questions

### How do I number rows automatically in Excel?

Put =ROW()-ROW($A$1) in the first data row and fill down. The numbers stay in order after you sort or delete rows.

### What does ROW() return with no argument?

The row number of the cell that contains the formula.

## Practice

A graded ROW exercise ("Running average") is on [the ROW page](https://spreadsheetpractice.com/functions/row). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
