looking for a more powerful way to number rows

Plasmech

New Member
Joined
Oct 26, 2021
Messages
44
Office Version
  1. 365
Platform
  1. Windows
In almost all of my spreadsheets, my first column is an line number / index number column. I code this as such:

A1 1
A2 =A1+1
A3 =A2+1
A4 =A3+1
A5 =A4+1
A6 =A5+1

But this is not a very powerful or forward-looking way to do it, however.

If I delete the 4th row, for example, rows 5 and 6 will return #REF!.

...and if I move a row, the numbers will no longer be sequential.

There must be a better way to do this, something embarrassingly obvious that I'm missing.

Any suggestions?

Thanks.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Adding values to a cell with a label produces an error unless you use the SUM function. If you want to remove the error in row 1 then you would have to use the IFERROR instead
 
Upvote 0
=IFERROR(OFFSET(A1,-1,0)+1,1)

Seems to handle all situations.

Thanks for your help on this!
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,803
Members
449,190
Latest member
cindykay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top