+ Reply to Thread
Results 1 to 6 of 6

Returning the most frequently occurring value from a list of strings, with a catch

  1. #1
    Registered User
    Join Date
    04-10-2020
    Location
    Toronto, Canada
    MS-Off Ver
    Excel for mac 14.7.2
    Posts
    9

    Returning the most frequently occurring value from a list of strings, with a catch

    Hello,

    I have a list of string values in a column and I need to write a command that returns the most frequently occurring value which is not "NA". For example:

    Dog
    Dog
    Dog
    Cat
    Cat
    NA
    NA
    NA
    NA

    I want the formula to return the value "Dog" despite the fact that NA is actually the most frequently occurring value. The internet helped me get this formula:
    =INDEX(A1:A9,MODE(MATCH(A1:A9,A1:A9,0))). I just need an extra tweak to help it say "except NA!" Any help appreciated

  2. #2
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: Returning the most frequently occurring value from a list of strings, with a catch

    =FREQUENCY( $A$1:$A$9, $B1:$B3)
    Where B1 - B3 is your criteria ie: Dog, Cat n/a etc.
    Last edited by BlindAlley; 04-27-2020 at 10:39 AM.
    Uploading an attachment will assist Forum Members in finding the correct Solution for you. Create a dummy worksheet if necessary, add your start data and show where / what your expected results should be. TO ADD A FILE:

    Go to 'Advanced. click on 'Manage Attachments. Select 'Browse & Choose your file, Select 'Upload and then close the Attachment window.

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Returning the most frequently occurring value from a list of strings, with a catch

    Hi

    to be confirmed with control+shift+enter

    =INDEX(A1:A9,MODE(IF(A1:A9<>"#NA",MATCH(A1:A9,A1:A9,0))))

    Regads
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    04-10-2020
    Location
    Toronto, Canada
    MS-Off Ver
    Excel for mac 14.7.2
    Posts
    9

    Re: Returning the most frequently occurring value from a list of strings, with a catch

    Ok, but what if the list is like this:

    Dog
    NA
    Dog
    NA
    NA
    Cat
    Dog
    Cat
    NA

    I have tried to put a list instead of the range you suggested, and it doesn't seem to work :/

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Returning the most frequently occurring value from a list of strings, with a catch

    Hi again,

    a different approach

    =INDEX(A1:A9,AGGREGATE(15,6,ROW(1:9)/(COUNTIFS(A1:A9,A1:A9,A1:A9,"<>#NA")=MAX(INDEX(COUNTIFS(A1:A9,A1:A9,A1:A9,"<>#NA"),))),1))

    just enter


    In the attachment formulas I'm excluding "NA" not "#NA"





    Hope it could work.
    Attached Files Attached Files
    Last edited by canapone; 04-27-2020 at 11:52 AM.

  6. #6
    Registered User
    Join Date
    04-10-2020
    Location
    Toronto, Canada
    MS-Off Ver
    Excel for mac 14.7.2
    Posts
    9

    Re: Returning the most frequently occurring value from a list of strings, with a catch

    Used this one: =INDEX(A1:A9,MODE(IF(A1:A9<>"#NA",MATCH(A1:A9,A1:A9,0))))
    and it worked perfectly! Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how to find most To most frequently occurring numbers in a column
    By eddie01001 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-10-2019, 07:32 PM
  2. Most frequently occurring text
    By okat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-22-2017, 09:41 AM
  3. Finding Most Frequently Occurring Combinations
    By seanpalmgren in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-18-2015, 04:01 PM
  4. Return most frequently occurring text in row
    By penfold in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-13-2011, 12:38 PM
  5. Count and identify most frequently occurring words
    By SueWithQuestion in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2011, 01:25 PM
  6. Most frequently occurring text
    By Deanomcbeano in forum Excel General
    Replies: 4
    Last Post: 08-12-2009, 08:58 AM
  7. most frequently occurring value
    By Pivotrend in forum Excel General
    Replies: 3
    Last Post: 12-23-2005, 08:10 AM

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