Auto Assign Serial Number to a text on other column in excel

203 Views Asked by At

please see below image to understand what i want to do.

Excel Data Image

John has serial# 1001, when john is repeated on client column, serial# is same as it was on first entry. How can i automate this process in excel?

2

There are 2 best solutions below

5
On BEST ANSWER

Put 1001 in A2. Then in A3 put:

=IF(B3<>"",IFERROR(INDEX($A$1:A2,MATCH(B3,$B$1:B2,0)),MAX($A$1:A2)+1),"")

And copy it down the column.

enter image description here

1
On

use the index/match formula:

=INDEX($A$1:$A3,MATCH(B4,$B$1:$B3,0))

index match