Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Most Frequent Text Value in Excel

Status
Not open for further replies.

honorbum

Technical User
Aug 26, 2005
50
US
I am trying to figure out how to look at a column of City names and in a cell, display the City name which occurs most often. Only formula I can find is "Mode" which will only give the most frequent "number" that occurs and not text.
 
I know it can be done in a pivot table but I don't have room to display the table. I was hoping there was a single cell formula I could use.
 


so you hide what you don't want to see and pick the Top 1.

Skip,

[glasses] [red][/red]
[tongue]
 
use the COUNTIF function

Me transmitte sursum, Caledoni!
 
I don't see how "COUNTIF" would work in this case? Also, I'm trying to avoid using a pivot in this case.

To expand: I have a list of trouble tickets for a specific regiona and I am simply trying to put one line in a report which reads: City with Most Tickets - (city name).
 


Use MS Query to get
Code:
Select MAX(City) From ThatSheet$


Skip,

[glasses] [red][/red]
[tongue]
 
MAX gives the largest numeric value of the text string. Doesn't work.
 


I was not thinking, sorry.
Code:
Select Count(*) From ThatSheet$
Where City = (Select MAX(City) From ThatSheet$)

Skip,

[glasses] [red][/red]
[tongue]
 
I gave in to the Pivot, created it on another sheet and then just cell referenced the Top city. I appreciate your help though Skip.
 
The following is an array, so be sure to press Ctrl+Shift+Enter after entering/pasting it into the formula bar:

=INDEX(A2:A12,MODE(IF(A2:A12<>0,MATCH(A2:A12,A2:A12,0))))

P.S.
I can't take credit for it. I had it in my personal knowledge base and it originally came from
 
Of course, the MAX count could pertain to more than one city. The array I previously posted will return the firstcity that equals the MAX count. Not sure how you would want to handle that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top