I'll try to keep this as concise as I can, basically, we have a list of codes (AA, AB, AC, AD, etc) that need to have a number incremented based on how many identical codes are in the list, the trouble is that this list won't be ordered alphabetically, below is an example of what is needed:

AA     1
AA     2
AD     1
AC     1
AA     3
AD     2

I think my question is similar to this post and this article, but these solutions only seem to work if the codes are alphabetically ordered (AA,AA,AA,AC,AD,AD - etc)

If anyone could nudge me in the right direction I'd be grateful, I hope I have been clear enough, Excel has never been my forte so excuse me if the answer is actually painfully obvious.


1 Answer 1


Data in column A do not need to be sorted.

Remember - the data can be visually the same but different (for example, it can have trailing spaces), in that case the formula will count full matches only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.