Find most common occurring text

scorp

Board Regular
Joined
Oct 28, 2005
Messages
54
I need to count the text that occurs the most in a column and return the word

For example a1 has dog a2 has cat a3 has dog

I need b1 to return dog as it's the most common occurence
 
Assuming that A2:A10 contains the data, try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=INDEX(A2:A10,MODE(IF(A2:A10<>"",MATCH("~"&A2:A10,A2:A10&"",0))))

However, since there can be more than one value tied for the most common occurring text, the following may be more appropriate...

B2, copied down:

=IF(ISNA(MATCH(A2,$A$1:A1,0)),COUNTIF(A2:$A$10,A2),"")

C2, copied down:

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

D1: 1

(This indicates that you want the top most common occurring text. This can be changed as desired. For example, for the Top 3, enter 3 instead.)

E1:

=MAX(IF(B2:B10=INDEX(B2:B10,MATCH(D1,C2:C10,0)),C2:C10))-D1

...confirmed with CONTROL+SHIFT+ENTER.

F2, copied down:

=IF(ROWS(F$2:F2)<=$D$1+$E$1,INDEX($A$2:$A$10,MATCH(ROWS(F$2:F2),$C$2:$C$10,0)),"")

Hope this helps!
 
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