Let A3:A13 house the following sample:
{"Name";"XZA";"XZA";"SDA";"XZA";"SDA";"XFA";"PQA"; "PQA";"XFA";"XFA"}
where A3 is a header, while A4, A5, and so on are text values.
The problem: What is the text value which is the most frequent?
A1: N
which is a label.
B1: 1
which signifies "the one that occurs most often".
A2: Ties of the Nth
which is a label.
B2:
=MAX(IF(INDEX(B4:B13,MATCH(B1,C4:C13,0))=B4:B13,C4 :C13))-B1
which must be confirmed with control+shift+enter, not just with enter.
B3: Count
which is a label.
B4, copied down:
=IF(ISNUMBER(MATCH(A4,$A$3:A3,0)),"",COUNTIF($A$4: $A$13,A4))
C3: Rank
which is a label.
C4, copied down:
=IF(N(B4),RANK(B4,$B$4:$B$13)+COUNTIF($B$4:B4,B4)-1,"")
D3: Most Freq
which is just a label.
D4, copied down:
=IF(ROW()-ROW($D$4)+1<=$B$1+$B$2,INDEX($A$4:$A$13,MATCH(ROW( )-ROW($D$4)+1,$C$4:$C$13,0)),"")
The result that you get in column D is a list, consisting one or more
items...
{"Most Freq";"XZA";"XFA"}
Standard formulas would give you just one item, a result that is not
correct.
maluli wrote:
I have a range of unit types and I want to count each unit type and return
the one that occurs most often.
|