+ Reply to Thread
Results 1 to 11 of 11

MODE formula not working as expected

  1. #1
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    383

    MODE formula not working as expected

    Hi All,

    I have a formula on the attached sheet on page 'Felicity' in cell V5 - for some reason the formula doesn't work but it's just a copy of the formulas in column V. I can't see why it doesn't work.

    Can anyone help?
    Attached Files Attached Files
    Last edited by AliGW; 11-14-2017 at 11:53 AM. Reason: Improved thread title.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Formula not working

    Your formulas are working fine.

    There is no mode for Nov-17 or for Jan-00.

    What value did you expect?

  3. #3
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    383

    Re: Formula not working

    I was expecting to see a 3, as the most common occurring number in column M.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,309

    Re: Formula stops working unexpectedly

    Why were you? There are a 3 and a 4 in the November range, so no most frequently occurring number (just one of each).
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,694

    Re: MODE formula not working as expected

    You will get an error because there is only single occurence of any value (3,5). Add another 3 to November and you get result of 3

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: MODE formula not working as expected

    Note that by the definition of mode, the mode is the value that appears the most in a list of values.

    If none of the values repeat, there is no mode.

  7. #7
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    383

    Re: MODE formula not working as expected

    I see, thank you. Is there a way of getting around this? Even if there was just a single occurrence I could still do with working!

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: MODE formula not working as expected

    Try this in V2:

    =IFERROR(MODE(IF(L$2:L$402=U2,M$2:M$402)),INDEX(M$2:M$402,MATCH(1,IF((L$2:L$402=U2)*(M$2:M$402<>""),1),0))) Ctrl Shift Enter

    If there is no mode (but there is a number), the formula will return the first matched number. If there is no mode and there is no number, the formula will return #N/A.

  9. #9
    Forum Contributor
    Join Date
    06-20-2012
    Location
    Derby
    MS-Off Ver
    Excel 2010
    Posts
    383

    Re: MODE formula not working as expected

    I see! Thank you, that's helped enormously.

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: MODE formula not working as expected

    You're welcome. Thanks for the rep!

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,679

    Re: MODE formula not working as expected

    Another option is to duplicate the results so that MODE always finds a result when there are any numbers present, e.g. with this array formula

    =MODE(IF($L$2:$L$402=U2,IF($M$2:$M$402<>"",$M$2:$M$402*{1,1})))

    confirm with CTRL+SHIFT+ENTER
    Audere est facere

+ 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. Format a part of a text working with only value not working with formula result
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2017, 05:41 AM
  2. [SOLVED] help index and match macro not working but formula working??
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2016, 06:37 AM
  3. Replies: 3
    Last Post: 05-14-2015, 07:32 AM
  4. Correct/Working (Index,Match) formula not working between cells
    By barnerd in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-11-2014, 01:20 PM
  5. Replies: 9
    Last Post: 03-08-2013, 11:50 AM
  6. Replies: 2
    Last Post: 08-17-2012, 08:16 AM
  7. Replies: 2
    Last Post: 08-01-2012, 11:53 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