sojim2
sojim2

Reputation: 1307

How to get the the sequential number on duplicates?

I'm not sure how to word this correctly, but I need to get the sequential number on duplicates in google sheets. For example, column Count is what I'm looking for:

+-------+-------+
| Name  | Count |
+-------+-------+
| Joe   |     1 |
| Lisa  |     1 |
| Jenny |     1 |
| Lisa  |     2 |
| Lisa  |     3 |
| Joe   |     2 |
| Jenny |     2 |

Sample sheet: https://docs.google.com/spreadsheets/d/1BB4bzzR3TTAfW5SwvNG_W3AsIYqlSEaSOad5wB4sdko/edit#gid=0

Any help is appreciated, thanks!

Upvotes: 0

Views: 97

Answers (2)

JPV
JPV

Reputation: 27282

For an array-enabled solution, you could try in C1

={"Count"; ArrayFormula(iferror(SORT(ROW(A2:A),SORT(ROW(A2:A),A2:A,1),1)-MATCH(A2:A,SORT(A2:A),0)-ROW()+1))}

For more background, also see this thread.

Upvotes: 1

sojim2
sojim2

Reputation: 1307

Got it, it's: =COUNTIF($A$2:A2,A2)

Upvotes: 0

Related Questions