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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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