Home » Questions » Computers [ Ask a new question ]

Autonumbering a column in Excel

Autonumbering a column in Excel

In my first column, I want to autonumber it from 1, 2, 3, 4, ..., x. How do I do that?

Asked by: Guest | Views: 255
Total answers/comments: 3
Guest [Entry]

"=1+R[-1]C
As you can check on the Microsoft Office Online Help, Excel doesn't have any tool for doing that, but you can fill it with the ROW function..."
"In the first row type 1, in the second row put this formula:

=IF(B2>0,SUM(A2+1),"""")

and drag all the way down in the sheet."
Guest [Entry]

"The simplest solution is to use the tables feature of excel - it provides you a column with implicit (calculated) formula which is expanded to all new rows in such table.

E.g. if you'd like to create autonumber in this format:

1/2/.../187/...

Insert this formula in the column of the table where autonumber should be placed:

=ROW()-ROW(Table1[[#Headers];[AutoNum]])

(replace table name with yours - here ""Table1"", and change reference to name of the autonumber column name - here ""AutoNum"")

If you'd like to create text autoID in this format:

""RowID_001""/""RowID_002""/.../""RowID_187""/...

Insert this formula in the column of the table where autoID should be placed:

=CONCATENATE(""RowID_"";TEXT(ROW()-ROW(Table1[[#Headers];[AutoNum]]);""000""))

(the format of number within autoID is defined by the string in the TEXT formula )"
Guest [Entry]

"Suppose you table starts at A5 (the header), then put in A6 this formula: ROW()-ROW($A$5)

This way it increments the number as you increase your table (by tabbing) and works when you delete a row."