Need top 5 most frequent (non-numeric) values

yobroham

New Member
Joined
Nov 14, 2014
Messages
1
I am trying to create a top 5 list of the most frequent values from a range. I know how to use the MODE function to get the most frequent number in a range, but I want to find the most frequent text...as well as get the next 4 most frequent. For example...

My range would be a1:a16 and I need a formula to place into d2 for the most frequent non-numerical value in the range, d3 for the second most frequent and so on...


ANY help would be greatly appreciated, excel newbie here :)
 
You could copy the values to another column, use Remove Duplicates to get a unique list, and then use a COUNTIF formula to count the occurrences of each.
 
Upvote 0
I am trying to create a top 5 list of the most frequent values from a range. I know how to use the MODE function to get the most frequent number in a range, but I want to find the most frequent text...as well as get the next 4 most frequent. For example...

My range would be a1:a16 and I need a formula to place into d2 for the most frequent non-numerical value in the range, d3 for the second most frequent and so on...


ANY help would be greatly appreciated, excel newbie here :)

[TABLE="width: 261"]
<TBODY>[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Fred
[/TD]
[TD="class: xl66, width: 28, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 28, bgcolor: transparent, align: right"]5
[/TD]
[TD="class: xl67, width: 104, bgcolor: transparent"]MOST FREQ
[/TD]
[TD="class: xl67, width: 78, bgcolor: transparent"]FREQ
[/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Ralph
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent, align: right"]2
[/TD]
[TD="class: xl69, bgcolor: #ffff99"]Fred
[/TD]
[TD="class: xl70, bgcolor: #ffff99, align: right"]4
[/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]George
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]5
[/TD]
[TD="class: xl69, bgcolor: #ffff99"]George
[/TD]
[TD="class: xl70, bgcolor: #ffff99, align: right"]3
[/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Susan
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl69, bgcolor: #ffff99"]Susan
[/TD]
[TD="class: xl70, bgcolor: #ffff99, align: right"]3
[/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Tom
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl69, bgcolor: #ffff99"]Tom
[/TD]
[TD="class: xl70, bgcolor: #ffff99, align: right"]2
[/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Jeff
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl69, bgcolor: #ffff99"]Jeff
[/TD]
[TD="class: xl70, bgcolor: #ffff99, align: right"]2
[/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Fred
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl69, bgcolor: #ffff99"][/TD]
[TD="class: xl70, bgcolor: #ffff99"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Tom
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Susan
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Fred
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]George
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Susan
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Fred
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Jeff
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]George
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, width: 110, bgcolor: white"]Carol
[/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
</TBODY>[/TABLE]

C1: 5 (Top 5)

C2, control+shift+enter (CSE), not just enter:
Rich (BB code):
=LARGE(FREQUENCY(IF($A$1:$A$16<>"",MATCH($A$1:$A$16,$A$1:$A$16,0)),
  ROW($A$1:$A$16)-ROW($A$1)+1),C1)

C3, CSE:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$1:$A$16<>"",MATCH($A$1:$A$16,$A$1:$A$16,0)),
  ROW($A$1:$A$16)-ROW($A$1)+1)>=C2,1))

D2, CSE and copy down:
Rich (BB code):
=IF($E2="","",INDEX($A$1:$A$16,SMALL(IF(FREQUENCY(IF($A$1:$A$16<>"",
  MATCH($A$1:$A$16,$A$1:$A$16,0)),ROW($A$1:$A$16)-ROW($A$1)+1)=$E2,
  ROW($A$1:$A$16)-ROW($A$1)+1),COUNTIF($E$2:E2,E2))))

E2, CSE and copy down:
Rich (BB code):
=IF(ROWS($E$2:E2)<=$C$3,LARGE(FREQUENCY(IF($A$1:$A$16<>"",
  MATCH($A$1:$A$16,$A$1:$A$16,0)),ROW($A$1:$A$16)-ROW($A$1)+1),
  ROWS($E$2:E2)),"")
 
Upvote 0

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