Try the following formulas in B1, C1 and D1 cells and copy it to down the rows (valid for 100 rows, please change if required)
B1==IF(COUNTIF(A$1:$A$100,A1)=1,"X",IF(COUNTIF($A1:A$2,A1)=1,A1,"X"))
C1=IFERROR(SMALL($B$2:$B$101,ROW()),"")
D1=IF(C1="","",COUNTIF($A$1:$A$17,C1))
Regards,
A.B. Mati