Type `1` in the first cell
Type `2` in the next cell
Select both cells
Drag the fill handle down to continue the series
Type `=ROW()` in the first row of your data
Type `=ROW()-1` if your data starts from row 2
Use `=SEQUENCE(n)` in Excel 365 or Excel 2021
Use `=ROWS($A$1:A1)` and fill down
Use `=COUNTA($A$1:A1)` and fill down if based on nonblank entries
Convert the range to a table and enter `=ROW()-ROW(Table1[#Headers])` in the first data row
Copy the formula down for all rows
