+ Reply to Thread
Results 1 to 4 of 4

Retrived 2nd Most Frequent Word in a List

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Retrived 2nd Most Frequent Word in a List

    I'm having a difficult time finding the answer to this problem. I need to find the nth most frequent text in a column of text. For example:

    Name:
    George
    Susan
    George
    Adam
    Adam
    Susan
    Susan
    Adam
    Susan

    I've used this formula which will retrieve the most frequent:
    {=INDEX($AK$3:$AK$1534,MATCH(MAX(COUNTIF($AK$3:$AK$15342,$AK$3:$AK$1534)),COUNTIF($AK$3:$AK$1534,$AK$3:$AK$1534),0))}

    And tried using Large, but am having no luck:
    {=INDEX($AK$3:$AK$1534,INDEX(COUNTIF($AK$3:$AK$1534,$AK$3:$AK$1534),LARGE(COUNTIF($AK$3:$AK$1534,$AK$3:$AK$1534),2)))}

    I think I may need to use Mode? But not sure. Any help is greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Retrived 2nd Most Frequent Word in a List

    I copied your list of names into cells A1-A9 and used the following formula to get the 2nd most common:

    =INDEX(A1:A9,MATCH(LARGE(COUNTIF(INDEX($A$1:$A$9,0),$A$1:$A$9),LARGE(COUNTIF(INDEX($A$1:$A$9,0),$A$1:$A$9),1)+1),INDEX(COUNTIF(INDEX($A$1:$A$9,0),$A$1:$A$9),0),0))

    As an array formula, obviously.

    The problem with using LARGE(<some array>,2) is that if your array is the counts for frequency of each name in your list it will look like {2,4,2,3,3,4,4,3,4}, so LARGE({array},1) is the same as LARGE({array},2) and LARGE({array},3) and LARGE({array},4), what you actually need is, in this case, the 5th largest element of the array.

  3. #3
    Registered User
    Join Date
    01-25-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Retrived 2nd Most Frequent Word in a List

    Adrewe-R thanks so much!!! Works perfectly. I would have never figured that out (at this point in my excel career)! How did you even know where to start? I have so much to learn.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Retrived 2nd Most Frequent Word in a List

    To be honest initially I couldn't work out why LARGE({array},2) wasn't working, but looking at your test example using the Evalutate Formula tool made it clear, after that it was just a case of working out how to get the Nth largest element.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1