Counting the instances of words

DC_C2C

New Member
Joined
Nov 25, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I am looking for a formula that counts the instances of a word but then returns a value based on the greatest number of instances.

In Col A I have twelve rows, 4 of them have the word ‘Low’, 6 have the word ‘Medium’ and 2 have the word ‘High’

I would like the formula to look at Cells A1:A12 and return a value of Medium

If the data changes and there are 5 ‘Low’ 4 ‘Medium’ and 3 ’High’ the resulting formula would display ‘Low’

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Excel Formula:
=LET(r,A1:A12,TAKE(SORTBY(r,COUNTIF(r,r),-1),1))
 
Last edited:
Upvote 0
What should happen if two words score the same? For example Low & High both appear 5 times & Medium twice
 
Upvote 0
In this case, the formula will return whichever value appears first in the IF statement it is checking. If you wish to have the formula return a different value in the case of a tie, you can modify the formula to check for equality between two values as well. So, if Low and High appear the same number of times, the formula could be changed to:

=IF(COUNTIF(A1:A12,"Low")>COUNTIF(A1:A12,"Medium"), "Low", IF(COUNTIF(A1:A12,"Medium")>COUNTIF(A1:A12,"High"), "Medium", IF(COUNTIF(A1:A12,"Low")=COUNTIF(A1:A12,"High"), "Tie", "High")))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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