For Excel how do I create a field that automatically generates a sequential number

12,007

What version of Excel? In 2007 and later you can use an Excel table. All formulas and formatting will automatically be applied to new rows.

Use the formula

=Row()

to create a unique number.

enter image description here

Then insert a new row above row 3 and you will see:

enter image description here

If you want the first data row in the table to be a 1, not a 2, use

=row()-1

In Excel 2003 you can use a list. I forget which versions earlier than 2003 support lists, but if you use anything older than 2003 you may want to consider upgrading, anyway. The formula is the same.

Before:

enter image description here

After inserting a new row:

enter image description here

Share:
12,007

Related videos on Youtube

gaunm
Author by

gaunm

Updated on September 18, 2022

Comments

  • gaunm
    gaunm over 1 year

    How do I create a field that automatically generates a unique number when I enter a new record in a table ?

    I have a list of numbers in the B column. I want the numbers in column A to automatically list as 1, 2, 3, 4, .....

    BUT

    When I insert rows so that I can add additional numbers to the B column, I want the A column to AUTOMATICALLY CORRECT its self and AUTOMATICALLY UPDATE the new empty cells in column A with the sequential numbers 1, 2, 3, 4, 5, 6, ......

    Is there some sort of CONDITIONAL FORMATTING that I can use? Formulas do NOT work because the new empty cells in column A dont AUTOMATICALLY FILL themselves.

    • Admin
      Admin almost 11 years
      It would seem that Access is the only way to accomplish what I want. Excel does not have the capability to auto format numbers sequentially after rows are inserted. :-(