Counting the instances of words

DC_C2C

New Member
Joined
Nov 25, 2022
Messages
4
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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
=IF(COUNTIF(A1:A12,"Low")>COUNTIF(A1:A12,"Medium"), "Low", IF(COUNTIF(A1:A12,"Medium")>COUNTIF(A1:A12,"High"), "Medium", "High"))
 
Upvote 0
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,215,433
Messages
6,124,863
Members
449,195
Latest member
MoonDancer

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