+ Reply to Thread
Results 1 to 4 of 4

Formula not returning correct result using MODE() function

  1. #1
    Registered User
    Join Date
    10-07-2016
    Location
    Lincolnshire
    MS-Off Ver
    2010
    Posts
    15

    Formula not returning correct result using MODE() function

    Hi all,

    I have four cells which show a number (the number is 1, 2, 3 or 4). I have a cell beside those which looks at all four cells and returns the most common number (I'm using MODE() for that). All worked fine. I had an error when it showed 1,2 3 and 4 so I modified the formula that if there was an error to show the highest (MAX()) value. Agai, worked perfectly well. I now have an issue if the results are 1,1,2,2 or 2,2,3,3 etc. Any result where there are two pairs effectively. The formula won't return the highest number. Any ideas? The formula I'm using is:

    =IF(ISERROR( MODE(T9:W9)),MAX(T9:W9),MODE(T9:W9))

    I'm using Excel 2011.

    TIA

    Jack
    Last edited by jackmcguigan1; 10-07-2016 at 12:49 PM.

  2. #2
    Registered User
    Join Date
    10-07-2016
    Location
    Lincolnshire
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula not returning correct result using MODE() function

    Apologies Jason, subject line now amended t reflect

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula not returning correct result using MODE() function

    Quote Originally Posted by jackmcguigan1 View Post
    I now have an issue if the results are 1,1,2,2 or 2,2,3,3 etc. Any result where there are two pairs effectively. The formula won't return the highest number. Any ideas? The formula I'm using is:

    =IF(ISERROR( MODE(T9:W9)),MAX(T9:W9),MODE(T9:W9))
    That's because you have a MODE value.

    1,1,2,2 or 2,2,3,3 are both multi-modal.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula not returning correct result using MODE() function

    Try this Array formula,

    =MAX(IF(MAX(COUNTIF(T9:W9,T9:W9))=COUNTIF(T9:W9,T9:W9),T9:W9))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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