Ok, So I have an excel file that have a column that may contain duplicate value like this
PO NUMBER PO COUNT P100
Assuming the data as you give it is in A1:B18 (with headers in row 1), enter this in B2:
A1:B18
B2
=IF(A1<>A2,MATCH(TRUE,INDEX(A2:A$1000<>A2,),)-1,"")
Copy down as required.
Amend the 1000 to a sufficiently higher row reference if necessary.