The fastest way to number rows in Excel

Excel can fill a sequence of numbers automatically once you give it the pattern. Type 1 in the first cell, 2 in the cell below it, then select both cells and drag the fill handle (the small square at the bottom-right corner of your selection) down as far as you need. Excel recognizes the pattern and continues the sequence for you.

If you only have a few rows, you can also type the starting number, then use the Fill Series feature. Select the range where you want numbers to appear, go to the Sheet menu (on Mac) or Home tab (on Windows), find Fill, and choose Series. Tell it to increment by 1, and it fills the selection with sequential numbers starting from your first entry.

For larger datasets or when you need more control, a formula approach works better and is easier to edit later if your data changes.

Key Takeaways

  • The drag-and-fill method works for small sequences: type 1 and 2, select both cells, then drag the fill handle down to auto-continue the pattern.
  • The Fill Series feature (Sheet menu on Mac, Home tab on Windows) lets you number an entire range at once without dragging.
  • The ROW() function creates sequential numbers that update automatically if you insert or delete rows, making it safer for changing data.
  • The SEQUENCE function (Excel 2021 and newer, or Excel Online) generates a full column of numbers in one formula with no dragging required.

Using the ROW() function for numbering that adjusts automatically

The ROW() function returns the row number of the cell it sits in. If you put =ROW() in cell A1, it shows 1. In A2, it shows 2. This is useful because if you later insert or delete rows, the numbers adjust on their own instead of staying stuck at their original values.

To start numbering from 1 instead of the actual row number, use =ROW()-ROW($A$1)+1 in your first cell, then copy it down. This formula subtracts the row number of your starting cell, so the sequence always begins at 1 no matter where you place it on the sheet.

If your data starts in row 5 (because rows 1–4 contain headers or labels), put =ROW()-4 in cell A5 and copy down. The numbers will start at 1 and count up from there.

The SEQUENCE function for one-step numbering

If you use Excel 2021, Excel 365, or Excel Online, the SEQUENCE function does all the work in a single formula. Type =SEQUENCE(10) in a cell and it creates a column of numbers from 1 to 10 instantly, with no copying or dragging required.

You can also control the starting number and the step size. =SEQUENCE(10,1,5,2) creates 10 numbers starting at 5, incrementing by 2 each time (5, 7, 9, 11, and so on). The format is SEQUENCE(rows, columns, start value, increment).

This function is the simplest method if your version supports it, because you type once and the entire sequence appears. You do not need to copy formulas or drag anything.

Numbering when your data is in multiple columns

If you want a single number column that counts rows across multiple columns of data, place your numbering formula in its own column to the left or right of your data. Use any of the methods above — ROW(), SEQUENCE(), or drag-and-fill — and the numbering stays independent of how many columns your actual data occupies.

If you need to number groups of rows (for example, rows 1–5 are Group A, rows 6–10 are Group B), you can use a formula like =INT((ROW()-1)/5)+1 to assign the same group number to every five rows. Adjust the 5 to match your group size.

Resetting the sequence when your data has gaps

If your data has blank rows or you want numbering to restart at certain points, the drag-and-fill method will not work correctly because Excel tries to continue the pattern across the gap. Instead, use a formula that counts only non-blank cells above the current row.

The formula =COUNTIF($A$1:A1,"<>") counts every non-empty cell from the top of your range down to the current row. Copy this down your column and it numbers only the rows with data, skipping blanks. This is slower than ROW() or SEQUENCE() for large datasets, but it handles gaps correctly.

Numbering in reverse or by custom increments

To number in reverse (10, 9, 8, 7...), use =ROW()-ROW($A$1)+1 as described above, then wrap it in a formula that subtracts from a fixed total: =11-ROW() if you want to count down from 10. Adjust the starting number to match your total rows.

For custom increments (numbering by 5s, 10s, or any other step), use =ROW()*5 to multiply the row number by your step size, or use SEQUENCE with the increment parameter: =SEQUENCE(20,1,1,5) for 20 numbers starting at 1, incrementing by 5 each time.

Frequently Asked Questions

What is the fill handle and how do I use it?

The fill handle is a small square at the bottom-right corner of a selected cell or range. Click and drag it downward to copy the cell's content or continue a pattern. In Excel, it appears as a tiny box you can grab with your mouse. On a trackpad, you may need to click and hold, then drag.

Why do my numbers stop incrementing when I drag?

Excel only recognizes a pattern if you select at least two cells showing the pattern (like 1 and 2, or 10 and 20). If you select only one cell and drag, Excel copies that cell instead of continuing a sequence. Always start by typing two numbers to establish the pattern.

Can I number rows without a formula?

Yes, using drag-and-fill or Fill Series. Both are built into Excel and do not require typing a formula. Drag-and-fill is faster for small ranges; Fill Series is faster for large ones because you do not have to drag the entire distance.

What happens to my numbers if I insert a new row?

If you used ROW() or SEQUENCE(), the numbers update automatically. If you used drag-and-fill or Fill Series, the numbers stay fixed at their original values and do not shift. Use a formula if you expect your data to change.

Can I number only visible rows and skip hidden ones?

Formulas like ROW() and SEQUENCE() number all rows, including hidden ones. To number only visible rows, you need a more complex formula or a manual approach. For most everyday tasks, numbering all rows (including hidden) is simpler and sufficient.