Ranking by How many times an item has been mentioned

VALVe101

Board Regular
Joined
May 1, 2016
Messages
52
Office Version
  1. 2016
Platform
  1. Windows
Hello All,

I have a Delima here where I need to give a rank for each time a duplicate text has been mentioned, something like a top-down scan.


in the picture attached, what I'm trying to do is not count how many times the name John has been mentioned rather than actually scanning from the top to bottom and count them each time it sees the name john, it adds an accumulation.

is there a formula that does that?
 

Attachments

  • Capture.PNG
    Capture.PNG
    8.5 KB · Views: 9

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=countifs(A$2:A2,A2)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=countifs(A$2:A2,A2)
thanks dude, this helped, I counted from the row of the item upwards, and it provided a ranking.
 
Upvote 0
An alternative is power query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Data", each _, type table [Name=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Count", each Table.AddIndexColumn([Data], "Index",1,1)),
    #"Expanded Count" = Table.ExpandTableColumn(#"Added Custom", "Count", {"Index"}, {"Count.Index"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Count",{"Data"})
in
    #"Removed Columns"

Book8
ABCD
1NameNameCount.Index
2JohnJohn1
3JohnJohn2
4MattJohn3
5JamesMatt1
6JohnJames1
Sheet1
 
Upvote 0
a good one also, as the formula is done on more than 20K rows and it is slowing the sheet down.
An alternative is power query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Name"}, {{"Data", each _, type table [Name=text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Count", each Table.AddIndexColumn([Data], "Index",1,1)),
    #"Expanded Count" = Table.ExpandTableColumn(#"Added Custom", "Count", {"Index"}, {"Count.Index"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Count",{"Data"})
in
    #"Removed Columns"

Book8
ABCD
1NameNameCount.Index
2JohnJohn1
3JohnJohn2
4MattJohn3
5JamesMatt1
6JohnJames1
Sheet1
 
Upvote 0
Maybe you missed this part of original post
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
If you are happy with a separate section showing the counts, that can be done very simply with a formula, depending of your version of Excel.
 
Upvote 0
Maybe you missed this part of original post

If you are happy with a separate section showing the counts, that can be done very simply with a formula, depending of your version of Excel.
done, updated
 
Upvote 0
Thanks for that.
With 2016 & over 20k rows, you are probably better of with the PQ solution, or a pivot table.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,693
Members
449,117
Latest member
Aaagu

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