Count the repeated values in a column and then numbering the results

zinah

Active Member
Joined
Nov 28, 2018
Messages
353
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have below table and what I need to do is to count how many repeated value in the column A, then number the results (the expected results column is what I need), anyone can help?

Book2
ABC
1EE IDCountifExpected Results
2AA131
3AA132
4AA133
5AA134
6AA135
7AA136
8AA137
9AA138
10AA139
11AA1310
12AA1311
13AA1312
14AA1313
15BB51
16BB52
17BB53
18BB54
19BB55
20CC21
21CC22
22DD81
23DD82
24DD83
25DD84
26DD85
27DD86
28DD87
29DD88
30EE21
31EE22
32F11
Sheet1
Cell Formulas
RangeFormula
B2:B32B2=COUNTIF($A$2:$A$32,A2)


Thank you!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi,

Use COUNTIF this way:

Book3.xlsx
ABC
1EE IDCountifExpected Results
2AA131
3AA132
4AA133
5AA134
6AA135
7AA136
8AA137
9AA138
10AA139
11AA1310
12AA1311
13AA1312
14AA1313
15BB51
16BB52
17BB53
18BB54
19BB55
20CC21
21CC22
22DD81
23DD82
24DD83
25DD84
26DD85
27DD86
28DD87
29DD88
30EE21
31EE22
32F11
Sheet1084
Cell Formulas
RangeFormula
C2:C32C2=COUNTIF(A$2:A2,A2)
 
Upvote 0
Solution
Hi,

Use COUNTIF this way:

Book3.xlsx
ABC
1EE IDCountifExpected Results
2AA131
3AA132
4AA133
5AA134
6AA135
7AA136
8AA137
9AA138
10AA139
11AA1310
12AA1311
13AA1312
14AA1313
15BB51
16BB52
17BB53
18BB54
19BB55
20CC21
21CC22
22DD81
23DD82
24DD83
25DD84
26DD85
27DD86
28DD87
29DD88
30EE21
31EE22
32F11
Sheet1084
Cell Formulas
RangeFormula
C2:C32C2=COUNTIF(A$2:A2,A2)
Perfect, thank you for your quick response!
 
Upvote 0
I offer you two power query solutions

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"EE ID"}, {{"Count", each Table.RowCount(_), Int64.Type}})
in
    #"Grouped Rows"

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"EE ID"}, {{"Data", each _, type table [EE ID=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Data],"Index",1)),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Index"}, {"Custom.Index"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Data"})
in
    #"Removed Columns"
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,422
Messages
6,119,396
Members
448,891
Latest member
tpierce

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top