To add a sequence number in an Excel formula, use the ROW() function or a simple counter. For a list starting in row 2, enter =ROW()-1 in the first cell and drag it down; this returns 1, 2, 3, and so on, and the numbers update automatically if you insert or delete rows. If you prefer a fixed sequence that does not change, type 1 in the first cell, 2 in the next, select both, and drag the fill handle down, or use =SEQUENCE(n) in Excel 365 and Excel 2021 to spill a dynamic array of numbers.

What You'll Need

  • Microsoft Excel (any recent version; the SEQUENCE function requires Excel 365 or Excel 2021, or Excel for the web).
  • A worksheet with data or a blank column where you want the numbers to appear.
  • Basic familiarity with entering formulas and dragging the fill handle (the small square at the bottom-right of a selected cell).

Step-by-Step

  1. Choose your method. Decide whether you want numbers that stay fixed when rows are added or deleted (static numbering) or numbers that renumber automatically (dynamic numbering). Static is simpler; dynamic uses a formula like ROW().
  2. For static numbering: click the first cell in your column, type 1, press Enter, type 2 in the cell below, press Enter. Select both cells, then drag the fill handle down as far as needed. Excel continues the pattern (3, 4, 5…). Alternatively, type 1 in the first cell, then hold Ctrl and drag the fill handle down to copy the same number; use the AutoFill Options button that appears to choose "Fill Series" instead.
  3. For dynamic numbering with ROW(): click the first cell where you want the sequence to start. Enter =ROW()-1 if your data starts in row 2 (so the first result is 1). If your data starts in row 1, use =ROW(). Press Enter, then drag the fill handle down. Each cell returns its own row number minus the offset, so the sequence stays correct even if you insert rows above.
  4. For a dynamic array (Excel 365/2021): click the first cell of the output range and type =SEQUENCE(10) to generate numbers 1 through 10 in a vertical spill. Use =SEQUENCE(10,1,1,1) for the same result with explicit rows, columns, start, and step. The numbers spill into adjacent cells; do not type anything in the spill range or you will get a #SPILL! error.
  5. Combine with other formulas if needed. To number only visible or filtered rows, use =SUBTOTAL(103,$A$2:A2) in the first data row and fill down; this counts visible non-blank cells and renumbers when you filter. To number within groups, use =COUNTIF($B$2:B2,B2) where column B holds the group value.
  6. Convert formulas to values (optional). If you want to freeze the numbers so they no longer change, select the cells, press Ctrl+C, then right-click and choose Paste Special > Values. This replaces the formulas with static numbers.
  7. Format and verify. Widen the column if numbers are cut off, and check the first and last cells to confirm the sequence is correct. If you used ROW(), insert a row above your data and confirm the numbers renumber as expected.

Common Mistakes

  • Using ROW() without an offset. If your data starts in row 2 and you use =ROW(), the first number will be 2, not 1. Subtract the number of rows above your data.
  • Dragging with Ctrl held. Holding Ctrl while dragging the fill handle copies the same number instead of incrementing it. Release Ctrl for a series, or use the AutoFill Options to switch.
  • Typing inside a SEQUENCE spill range. This causes a #SPILL! error. Clear the blocking cells or move the formula.
  • Forgetting that static numbers do not update. If you insert a row in a statically numbered list, the numbers below will not shift automatically. Use ROW() or SUBTOTAL if you need automatic renumbering.
  • Using SUBTOTAL with the wrong function number. 103 counts visible non-blank cells; 3 counts all non-blank cells including hidden rows. Choose based on whether you filter or hide rows.

Tips

  • Use =ROW(A1) instead of =ROW() if you want the sequence to start at 1 regardless of where the formula sits; dragging down adjusts the reference.
  • For a numbered list that restarts at each new section, use =IF(B2<>B1,1,C1+1) where B is the section column and C is the number column.
  • To number only rows that meet a condition, combine IF and COUNTIF: =IF(D2="Yes",COUNTIF($D$2:D2,"Yes"),"").
  • Press Ctrl+Enter after typing a formula to fill the entire selected range at once, which is faster than dragging.
  • If you need a sequence in a table, Excel tables auto-fill calculated columns; enter the formula once and it propagates to new rows.

Troubleshooting

  • Numbers do not increment when dragging: check that you selected two cells with 1 and 2 before dragging. If only one cell is selected, Excel copies the value. Use the AutoFill Options button to choose Fill Series.
  • ROW() returns the wrong start: adjust the offset. If your first data row is 5, use =ROW()-4 to start at 1.
  • #SPILL! error with SEQUENCE: the spill range is blocked by existing data or merged cells. Clear the cells below and to the right, or move the formula to an empty area.
  • Numbers change unexpectedly after sorting: ROW() recalculates based on position, so sorting can renumber. If you need fixed numbers tied to records, paste as values before sorting.
  • SUBTOTAL does not renumber after filtering: ensure you used function number 103 and that the range starts at the first data row with an absolute reference ($A$2:A2).

Frequently Asked Questions

How do I add a sequence number in Excel without dragging?

Type 1 in the first cell, select the range you want to fill, then use Home > Fill > Series and set the step value to 1. Alternatively, enter =SEQUENCE(n) in Excel 365 or 2021 to spill the numbers automatically.

Why does my ROW() formula start at 2 instead of 1?

ROW() returns the actual row number of the cell. If your formula is in row 2, subtract 1: =ROW()-1. Adjust the offset to match how many rows sit above your first data row.

Can I number only filtered rows?

Yes. Use =SUBTOTAL(103,$A$2:A2) in the first data row and fill down. The 103 function counts visible non-blank cells, so hidden rows are skipped and the sequence renumbers when you filter.

What is the difference between static and dynamic numbering?

Static numbers are typed or pasted as values and stay fixed when rows are inserted or deleted. Dynamic numbers use formulas like ROW() or SUBTOTAL and update automatically to reflect the current row order.

How do I restart numbering for each group?

Use a COUNTIF formula that counts occurrences of the group value up to the current row: =COUNTIF($B$2:B2,B2), where B is the group column. Each new group starts at 1.

Does SEQUENCE work in older Excel versions?

No. SEQUENCE is available only in Excel 365, Excel 2021, and Excel for the web. In older versions, use ROW() or manual fill instead.