Basically, I have a dataset of bird bands, with one or more instances of each color.band code per year. I want to have a column that counts up one digit each time a given color.band code occurs. So if XXXXXX occurs two times, the first one would have a 1 next to it and the second one a 2. If YYYYYY had only one occurrence it would only have a 1, and so on. I'm not sure how to begin doing this. How could I do this? Thank you!

 
     
    