Yes, you can number cells in Excel automatically with a simple formula instead of typing numbers by hand. The quickest way is to type =ROW()-1 in the first cell of your list (assuming your data starts in row 2), then drag the fill handle down. Each row gets its own number, and the numbering updates itself when you insert or delete rows. Below are the exact steps for several common situations.
What You'll Need
- A computer with Microsoft Excel (the steps below work in Excel for Microsoft 365, Excel 2019/2021, and the free Excel for the web; menu labels can differ slightly between versions)
- An existing spreadsheet, or a blank workbook to practise on
Step-by-Step
- Open your workbook and go to the worksheet where you want numbered cells.
- Click the first cell where numbering should start. For a list beginning in row 2 (with headers in row 1), click cell A2.
- Type the formula =ROW()-1 and press Enter. ROW() returns the row number, so subtracting 1 makes the first data row show 1. If your data starts in row 5, use =ROW()-4 instead — always subtract (start row minus 1).
- Drag the fill handle down. Hover over the small square at the bottom-right corner of the cell until the cursor becomes a thin plus sign, then drag down over the cells you want numbered. Release, and each cell shows 1, 2, 3, and so on.
- Alternative: use a formula that survives deleted rows. In newer versions of Excel you can type =SEQUENCE(10) in one cell to spill the numbers 1 through 10 down automatically. Replace 10 with however many numbers you need, or use =SEQUENCE(ROWS(B2:B100)) to match the length of your data in column B.
- To number only rows that contain data (skipping blanks), use =IF(B2="","",COUNTA($B$2:B2)) in cell A2 and copy it down. This counts non-empty cells in column B as it goes, so blanks get no number.
- To fill a column quickly without dragging, select the range you want (for example A2:A50), type the formula, and press Ctrl+Enter (Cmd+Enter on Mac) to enter it in every selected cell at once.
Common Mistakes
- Forgetting to subtract the offset. =ROW() in row 2 gives 2, not 1. Always subtract (starting row − 1) so your list starts at 1.
- Numbers that shift when you sort. Because ROW()-based numbering is tied to position, sorting your data will renumber everything in visual order. If you want permanent ID numbers, copy the numbered cells and use Paste Special > Values to freeze them, or type the numbers manually.
- Headers included in the range. Check that your formula range starts below the header row, or row 1 will be numbered too.
- Dragging the wrong corner. Only the small square at the bottom-right of the cell (the fill handle) copies formulas; dragging the cell border moves it.
Tips
- For a numbered list that also works in filtered tables, =SUBTOTAL(103,$B$2:B2) numbers only visible rows, so filtering hides numbers along with rows.
- Convert your data to a Table (select it and press Ctrl+T) and calculated columns will copy your numbering formula to new rows automatically.
- To restart numbering for each group (for example each new customer), a COUNTIF-based formula or a manual reset works better than ROW().
- You can combine numbering with text, like =ROW()-1&"." to get "1.", "2.", and so on for a written list.
Troubleshooting
- The formula shows as text instead of calculating. The cell is probably formatted as Text. Select the cells, go to Home > Number Format and choose General, then re-enter the formula (press F2 and Enter).
- All cells show the same number. You may have typed a fixed number rather than a formula, or pasted values. Re-enter the formula and use the fill handle or Ctrl+Enter.
- SEQUENCE gives a #NAME? error. SEQUENCE is only available in Excel 365 and Excel 2021 and later. On older versions, use the ROW() method instead.
- Spill range blocked (#SPILL! error). Something is in the way of a SEQUENCE result. Delete the contents of the cells below the formula so the numbers can spill.
- Numbers don't update after deleting rows. If you pasted values, they are static by design. Reapply the formula if you want automatic renumbering.
Frequently Asked Questions
What is the simplest formula to number cells in Excel?
=ROW()-1 in the second row of a sheet, copied down with the fill handle. It returns sequential numbers based on each cell's row position.
How do I number cells starting from 1 when my data starts in row 1?
Just use =ROW() with no subtraction — the row number already equals 1 in the first row.
How do I make the numbers stay put when I sort my data?
Copy the numbered column and use Paste Special > Values to convert the formulas to fixed numbers before sorting, or type the IDs manually.
Can I number cells with a formula in Excel for the web?
Yes. ROW(), COUNTA and SEQUENCE all work in Excel for the web, and the fill handle behaves the same way.
How do I number every other row or use a custom step?
Multiply or adjust the formula, for example =(ROW()-1)*2 for even numbers (2, 4, 6...) or =ROW()*5-5 for steps of five.