Numbering a class list, staff list or stock sheet by hand is slow and breaks when you add or delete rows. Excel can do it for you.
Method 1: fill handle (quickest)
- Type 1 in A2 and 2 in A3.
- Select both cells.
- Double-click the fill handle (small square at the bottom-right of the selection). Excel fills down as far as the data next to it goes.
Method 2: ROW function (stays correct)
In A2 type =ROW()-1 and fill down. If your header is on row 1, this gives 1 on row 2, 2 on row 3, and so on. Deleting a row renumbers everything.
Method 3: SEQUENCE (Excel 365/2021)
Type =SEQUENCE(100) in A2 to get 1 to 100 instantly. Use =SEQUENCE(COUNTA(B2:B500)) to match the number of names in column B.
Number only rows with data
In A2: =IF(B2="","",COUNTA($B$2:B2)), then fill down. Empty rows stay blank.
| Method | Best for | Updates automatically? |
|---|---|---|
| Fill handle | Quick one-off lists | No |
| =ROW()-1 | Lists you edit | Yes |
| =SEQUENCE() | Excel 365/2021 | Yes |
| IF + COUNTA | Lists with gaps | Yes |
Google Sheets
The same formulas work: =ROW()-1, =SEQUENCE(100) and the IF/COUNTA formula.
Related guides
Checked on 10 November 2026 for Windows 11 and current Microsoft 365. Older versions may look slightly different.
Common questions
How do I quickly number rows in Excel?
Type 1 and 2 in the first two cells, select both, then double-click the fill handle (small square at the bottom-right).
How do I keep numbering correct after deleting rows?
Use =ROW()-1 (adjust for header rows) instead of typed numbers.
How do I number 1 to 100 in one go?
In Excel 365/2021, type =SEQUENCE(100) in the first cell.
How do I number only rows with names?
Use =IF(B2="","",COUNTA($B$2:B2)) and fill down.