The Excel ROW function returns the row number of a cell — either the cell you point it at, or the cell the formula lives in when you give it no argument at all. That second trick is the famous one: it powers row numbering that repairs itself when rows are deleted, alternating-row formats, and every-nth-row calculations. Its sibling COLUMN does the same job sideways.
=ROW(C7) returns 7. With no argument, ROW returns the row of the formula’s own cell:
Syntax
| Argument | Description | |
|---|---|---|
reference | Optional | The cell (or range) whose row number you want. Omit it and ROW returns the row of the cell containing the formula. |
Given a multi-row range, ROW returns the row number of every row: in Excel 365/2021 =ROW(C5:C8) spills 5, 6, 7, 8 down the sheet. In older versions you’ll only see the first value unless the formula is used inside an array calculation.
ROW with and without a reference
Point ROW at any cell and it reports the worksheet row, whether or not the cell holds anything:
Leave the argument out and ROW describes its own location. The numbered list below has =ROW()-1 in every cell of column A — row 2 shows 1, row 3 shows 2, and so on:
| A | B | |
|---|---|---|
| 1 | # | Task |
| 2 | 1 | Collect timesheets |
| 3 | 2 | Approve invoices |
| 4 | 3 | Update forecast |
| 5 | 4 | Send status report |
| 6 | 5 | Book training room |
Because nothing is hard-coded, deleting the “Approve invoices” row instantly renumbers the list 1–4 with no gaps — something typed numbers can never do.
Try it: interactive ROW demo
Type any cell address to see what ROW returns — then move an argument-free =ROW() around the sheet.
Practical uses: numbering, banding, every nth row
1. Numbering that survives deletions. Typed numbers leave gaps when rows are deleted. =ROW()-1 (subtract however many header rows sit above the list) always shows an unbroken sequence:
2. Alternating-row logic. Feed ROW to ISEVEN or MOD inside conditional formatting to shade every other row — banding that survives sorting and inserting:
3. Every nth row. Sum every 3rd row of a column by testing row positions:
4. Sequences inside formulas. Before SEQUENCE existed, ROW(INDIRECT("1:"&n)) was the standard way to generate the numbers 1 to n inside an array formula — you’ll still meet it in older workbooks. In Excel 365, prefer SEQUENCE.
Errors & common pitfalls
Pitfall: the offset is hard-coded. =ROW()-1 assumes exactly one header row. Insert a second header row above the list and every number shifts by one. Re-check the offset whenever the layout above your list changes.
Pitfall: ROW counts worksheet rows, not list items. ROW reports position on the sheet. If you need “position within a range”, use ROW()-ROW(first_cell)+1 or MATCH instead.
Pitfall: ROW vs ROWS. ROW returns a row number; ROWS returns a count of rows in a range. =ROW(A5:A8) gives 5 (or spills 5–8); =ROWS(A5:A8) gives 4.
#NAME? — misspelled function. Usually ROWS() typed with an argument ROW expected, or a typo like =ROW(C7 missing its parenthesis. ROW itself exists in every Excel version, so #NAME? always means a typing problem.
Practice workbook
Frequently asked questions
What does =ROW() with no argument return?
=ROW() in cell D7 and it returns 7. That makes it the engine behind self-repairing row numbering like =ROW()-1.How do I number rows so the numbers survive deleting rows?
=ROW()-1 in the first data cell (for a list starting in row 2) and copy down. Each formula computes its number from its own position, so deleting a row renumbers everything instantly. Adjust the subtraction to match your header rows.What's the difference between ROW and ROWS?
Why does =ROW(A5:A8) show more than one number?
Can I use ROW to shade every other row?
=MOD(ROW(),2)=0 and pick a fill. Even-numbered rows shade, and the banding survives sorting, inserting, and deleting — unlike manually painted fills.Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class