View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default How to Autonumber Rows but Retain Same Number for Duplicate Entrie

Hi,

Lets assume these names are in A1 down, the first number will be 1 (or
whatever start number you choose) so put this in B1. Then put this formula in
B2. Double click the fill handle and it will fill down and number your names

=IF(COUNTIF($A$1:A2,A2)=1,MAX($B$1:B1)+1,LOOKUP(2, 1/($A$1:A1=A2),$B$1:B1))

Mike

"Caledoniain" wrote:

I have a very large Excel 2007 database (over 13,000 entries) and I need to
transfer the data into SPSS. In order to do so, I need to convert one column
of text-labelled data (people's names) into numerical identifiers. However,
some people are deliberately included on more than one row. What I want to do
is find a way of allocating a unique numerical identifier to each unique
entry, NOT to each row of data. In other words, I want each person to have
their own ID which will be the same regardless of whether they appear in row
1, row 5000 or row 12,000 of my dataset.

Can somebody please explain how I go about doing this, please? Many thanks!