The ROW function

Returns the row number of a cell. Left empty, it returns the row of the cell the formula is in.

Syntax

ROW([reference])
reference (optional)
The cell to get the row number of. Left out, the formula's own cell.

Examples

B1=ROW(C7)
AB
17
A4=ROW()-1
AB
1Name
2Ann
3Ben
43Cy
B6=IF(MOD(ROW(),2)=0,"Even row","Odd row")
AB
1
2
3
4
5
6Even row

Read the guide

Questions

How do I number rows automatically?

In row 2, type =ROW()-1 and fill it down. The numbers stay right when you delete or insert rows. In Excel 365 you can also spill them with SEQUENCE.

What is the difference between ROW and ROWS?

ROW returns the row number of a cell, so ROW(C7) is 7. ROWS counts the rows in a range, so ROWS(C2:C7) is 6.

Related functions