Simple list question..

olly_w

Board Regular
Joined
Jul 2, 2003
Messages
189
I have a list of 10 text values i.e names e.e joe bloggs, and i want to put a worksheet formula to return the most frequently occurring name within this range, how do i do this ? Tried mode, but that only works for numerical values.
any help greatly appreciated
cheers
olly
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi,

Try:

=INDEX(A1:A10,MATCH(MAX(COUNTIF(A1:A10,A1:A10)),COUNTIF(A1:A10,A1:A10),0))

Entered with Ctrl + Shift + Enter

If more than one appears the max time, only the first will be returned.

(Your data in A1 to A10)
 
Upvote 0
I'd give the same answer as I posted earlier,

http://www.mrexcel.com/board2/viewtopic.php?t=23178

but there is more to it...

What follows also invokes the solution to the so-called Top N class of problems.
aaModeOrMostFrequent olly_w.xls
ABCDEFG
1NameCountRank1XZA
2XZA211XZA
3XZA  XZA
4SDA22SDA
5CFA13 
6SDA   
7XFA14 
8PQA15 
9
10
Sheet1


Ordinarily, the formula in G1...

=INDEX(A2:A8,MATCH(MAX(COUNTIF(A2:A8,A2:A8)),COUNTIF(A2:A8,A2:A8),0))

which must be confirmed with control+shift+enter instead of just enter, is the answer. G2 houses the same using morefunc...

=INDEX(A2:A8,MATCH(MAX(SETV(COUNTIF(A2:A8,A2:A8))),GETV(),0))

However, a data set can have two or more MODE values...

The following formula set captures multiple values...

B2:

=IF(ISNUMBER(MATCH(A2,$A$1:A1,0)),"",COUNTIF($A$2:$A$8,A2))

C2:

=IF(N(B2),RANK(B2,$B$2:$B$8)+COUNTIF($B$2:B2,B2)-1,"")

E1 houses 1 (meaning: Top N with N = 1)

E2:

=MAX(IF(INDEX(B2:B8,MATCH(E1,C2:C8,0))=B2:B8,C2:C8))-E1

which must be confirmed with control+shift+enter instead of just with enter.

E3:

=IF(ROW()-ROW($E$3)+1<=$E$1+$E$2,INDEX($A$2:$A$8,MATCH(ROW()-ROW($E$3)+1,$C$2:$C$8,0)),"")



Formulas
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,981
Members
449,058
Latest member
oculus

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