Thứ Năm, 14 tháng 8, 2014

AUTONUMBER IN EXCEL

HOW TO AUTONUMBER IN EXCEL

TO CREATE AN AUTONUMBER FIELD IN EXCEL, YOU HAVE A FEW OPTIONS - EACH WITH ITS OWN SET OF LIMITATIONS

To create an autonumber field, you could try using the row() function. This function returns the current row number.



The limitations of this option is that if you insert a new row, your row() function will return a different value in the lines below the inserted line. So in this option, you will not be able to keep your primary key static if you are inserting new rows in the middle.
Also, you insert a blank row, you'll need a way to fill in the formula.


To create an autonumber field, you could try using the Offset() function.
In cell A1, enter the number 1.
Then in cell A2, enter the formula:
=OFFSET(A2,-1,0)+1
Then copy the formula from cell A2, down as far as you need.
The limitations of this option is that if you insert a new row, you will need to readjust all of your formulas (below the row inserted). So there is more maintenance involved than option #1.
Also, this option does not allow you to keep your primary key static if you are inserting new rows in the middle.

0 nhận xét:

Đăng nhận xét