Pete T
Pete T

Reputation: 31

How to auto-number groups of names in an Excel column?

Does anyone know how can I auto-number column "B" based on column "A"?

Let me give you an example on how column A looks like:

John
John
Mike
Mike
Mike
Mike
Andy
Andy
Andy
Andy
Andy
Andy
Andy

Now I want to add numbering in column "B" based on column A, like this:

John 1
John 2
Mike 1
Mike 2
Mike 3
Mike 4
Andy 1
Andy 2
Andy 3
Andy 4
Andy 5
Andy 6
Andy 7

I need to do this for a list of 20k records so I need to find an automatic solution.

Upvotes: 0

Views: 120

Answers (1)

BruceWayne
BruceWayne

Reputation: 23285

You can use COUNTIF().

In B1 and drag down:

=COUNTIF($A$1:A1,A1)

Upvotes: 3

Related Questions