+ Reply to Thread
Results 1 to 6 of 6

Multiple Mode Formula Malfunction. Please Help?

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    essoarde 1st
    MS-Off Ver
    Excel 2010
    Posts
    7

    Multiple Mode Formula Malfunction. Please Help?

    I'm trying to calculate the nth mode of an array. Here is the formula:

    I can get this formula to work when I create a random list of numbers in A1:A23 (for example) in a blank excel sheet, but when I try to run the above formula for a column in an exported table, I keep getting a #REF error...Help?

    The Formula:

    =MATCH(MATCH(LARGE(FREQUENCY(Q8:Q338,ROW(INDIRECT(MIN(Q8:Q338)&":"&MAX(Q8:Q338)))),2),FREQUENCY(Q8:Q338,ROW(INDIRECT(MIN(Q8:Q338)&":"&MAX(Q8:Q338)))),0),ROW(INDIRECT(MIN(Q8:Q338)&":"&MAX(Q8:Q338))),0)

    The "2" in the middle of the first line denotes the 2nd most frequent number. You may substitute any other number or a cell reference containing the number n for the nth most frequent.
    This is an array formula and, after you type or paste it into the cell, hold down <ctrl><shift> while hitting <enter> in order to *array-enter*. XL will place braces {...} around the formula.


    Sheet 1 is where the formula works.

    Sheet 2 is the relevant part of what I've pulled, and where it isn't working.
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Multiple Mode Formula Malfunction. Please Help?

    The error is on account of '0' values in your range of data, which is why the INDIRECT() will not execute, meanwhile will work on an alternative solution
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Multiple Mode Formula Malfunction. Please Help?

    Hi pfallonj,

    Why not use Count instead of Mode in your table. See a Pivot Table solution where you can show only the top 5 and sort them from large to small. No formulas needed, just a little pivot table drag and drop.

    See the attached... I think you got a bad answer on sheet 2 because you didn't have values all the way down in your column.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    09-13-2012
    Location
    essoarde 1st
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple Mode Formula Malfunction. Please Help?

    MarvinP,


    What on earth did you do?


    I've only used Excel intermittently over the years, and pivot tables and all other things useful in excel are a bit fuzzy for me. I've had to piece things together slowly as I go along, and scower forums for things I can try to use.


    Mind walking me through what you did?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Multiple Mode Formula Malfunction. Please Help?

    Hi,

    See if this screencast helsp
    http://screencast.com/t/Marf0LcQBMX

    On your sheet 2 you will need to do a similar thing after inserting a blank row where your data stops.

  6. #6
    Registered User
    Join Date
    09-13-2012
    Location
    essoarde 1st
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Multiple Mode Formula Malfunction. Please Help?

    MarvinP,

    That worked. Thanks.

+ 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