Hi Khalid,
Your formula will work for this type of output data requirement, where all the names say ABC appearing 5 times in alternate rows. But considering the situation if ABC is in row 2,3 and than on row 10, I think it will fail. Just try experimenting with this.
Where as in my formula: in SMALL function is used to get row number by comparing name and assigning a unique no. than COUNTIF will give 1,2,3 and so on as we drag the formula down as the range in it is expanding in nature so we will get 1st Small, than 2nd and 3rd and so on.
Regards,