+ Reply to Thread
Results 1 to 13 of 13

Formula list the most frequently occuring numbers in an expanding array

  1. #1
    Registered User
    Join Date
    12-28-2019
    Location
    Trinidad
    MS-Off Ver
    2010
    Posts
    15

    Formula list the most frequently occuring numbers in an expanding array

    Hi All,

    I'm struggling so far without any solution to find a way to use this formula to list the most frequently occuring numbers with multiple IF criteria:

    Please Login or Register  to view this content.
    That formula list the most frequently occuring numbers in an expanding array as explained at this link:
    exceljet.net/formula/list-most-frequently-occuring-numbers

    I'm new here so I'm not sure if I'm allowed to post a link to another website here so if that's against the rules I apologize. It's just that it's must easier to explain my problem by referrencing that link.

    Anyway, my problem is how can I add multiple criteria to the formula as I did in the formula below.
    Please Login or Register  to view this content.
    The problem with the formula above is that it only results in reporting the most frequently occurring number, instead of the most frequent followed by the second most frequent, then the third most frequent, etc as the first formula does. But how to add these multiple IF criteria to the MODE(IF(1-ISNUMBER(MATCH function?

    Please Login or Register  to view this content.
    I left out the IF(Q12:Q1000<>"") condition because I think that IF(1-ISNUMBER) should take care of that.

    So I tried this:
    Please Login or Register  to view this content.
    But that did not work so where should I insert the additional IF conditions? Can anyone help me solve this? Thanks.

    Also, what is the formula to list the number of times each frequently occurring number occurs as shown in the Count column of the example at the link I posted? Any ideas anyone? Thanks again.
    Last edited by AliGW; 12-31-2019 at 02:07 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,676

    Re: Formula list the most frequently occuring numbers in an expanding array

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. You are new, so I did it for you this time.)

    Instructions about attaching workbooks are at the top of the page.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,676

    Re: Formula list the most frequently occuring numbers in an expanding array

    I changed your title and explained why - do NOT re-edit something that a moderator has changed. Thanks.

  4. #4
    Registered User
    Join Date
    12-28-2019
    Location
    Trinidad
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula list the most frequently occuring numbers in an expanding array

    I'm sorry. I was so busy editing and re-editing my post that I didn't realize that you already changed the title. Thanks.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,676

    Re: Formula list the most frequently occuring numbers in an expanding array

    Please provide a sample workbook - instructions at the top of the page.

  6. #6
    Registered User
    Join Date
    12-28-2019
    Location
    Trinidad
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula list the most frequently occuring numbers in an expanding array

    Ok, I attached a sample workbook with 3 different formulas to list the most frequently occuring numbers in an expanding array along with the frequency of occurrence of each number. And to make it easy to follow what I'm asking, I created the following 5 named ranges in the sample workbook: list=B5:B54, type=H5:H54, score=I5:I54, selectedtype=I1 and threshold=I2. Plus I showed the formula texts for each formula. Here are the 3 formulas I used:
    Please Login or Register  to view this content.
    So my problem is how can I add these multiple IF criteria to the 3 expanding range formulas in my sample workbook:
    Please Login or Register  to view this content.
    By adding those 3 criteria I would like to list the most frequently occuring numbers in the list (B5:B54 range) that are of the BR type (H5:H54 range) with a score (I5:I54 range) that is > 2.9 (the threshold) and blank cells in the list should be ignored. I tried inserting the 3 IF criteria into these 3 formulas in many different ways without any successful result so where should I insert those additional IF conditions? Can anyone help me solve this? Thanks.
    Attached Files Attached Files

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

    Re: Formula list the most frequently occuring numbers in an expanding array

    *Untested*

    In D16 (array-entered)

    =IFERROR(MODE(IF(score>threshold,IF(type=selectedtype,IF(list<>"",IF(COUNTIF(D$15:D15,list)={0},list))))),"")

    Adapt for other ranges accordingly
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  8. #8
    Registered User
    Join Date
    12-28-2019
    Location
    Trinidad
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula list the most frequently occuring numbers in an expanding array

    Wow, thank you very much for your reply that came so fast even though today is New Year's Day. It works perfectly.

  9. #9
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Formula list the most frequently occuring numbers in an expanding array

    Hi

    That's a very nice formula from Ace, but if you choose type OFF for your dropdown Type entry, you don't get any result shown, but clearly there is an entry for Type OFF with List of 30 and a Score of 18.1 (which meets your requirement that it is above your selected threshold of above 2.9)

    When using your threshold setting of above 2.9 and selecting Type BR, I would expect to see the 10 most frequent List entries as..
    21, 43, 78, 9, 82, 10, 52, 74, 22, 66
    ..in the strict order of entries in the list.

    If I then select Type SR, I would expect to see the 10 most frequent List entries as..
    11, 63, 34, 26, 66, 98, 17, 47, 49, 95

    zeddy

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

    Re: Formula list the most frequently occuring numbers in an expanding array

    @zzzeddy
    The MODE function returns values only if repeated i.e. occurring at least twice, which, I reckon the formula I provided achieves. The other values as listed in your post occur just once after meeting the criteria, hence are not listed.

    @ globally
    Is my understanding of your requirements correct?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  11. #11
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Formula list the most frequently occuring numbers in an expanding array

    Hi Ace

    Let me be clear - yours is a great formula, and I'm sure it does what's been asked for in the posted sample file. Job done. User is happy.

    I was just thinking about a larger set of data, where you might have many duplicate values, and where the data sequence and order may be important. This can affect the order of results presented, depending on the definition of what should come first.

    So in the example file posted, with your formula:
    21 is listed first because it is the item that is most frequent, and it is the only item that has a frequency-count of 3 entries.
    43 and 78 are listed next, because they both have the next frequency-count of 2, and because 43 appears in the list before the entry 78, it comes next.

    If we changed the last two entries in the posted list to 9, there will be a frequency-count of 3 for this item, same as for item 21, but it will now appear as the first reported item, simply because the first "9" appears before the first "21" in the list. In my system, the three "21" values would be encountered before the three "9" values, so the reported order would be 21, 9, ..

    zeddy

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

    Re: Formula list the most frequently occuring numbers in an expanding array

    @zzzeddy

    Interesting proposition. I'm afraid, I reckon we need a helper column to get what you desire in order to ascertain which three values were encountered earlier, since the MODE function is not capable of handling that.

    See attached an abbreviated mock-up of what you were suggesting. The helper column is Col. F and the final output is Col. G. I also interchanged the 43 and 78 in the list to suit what you were suggesting and ensure it works at all times

    formula-list-the-most-frequently-occuring-numbers-in-an-expanding-array-samplemostfreqnums.xlsx

    P.S. thanks for the rep

  13. #13
    Registered User
    Join Date
    12-28-2019
    Location
    Trinidad
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula list the most frequently occuring numbers in an expanding array

    Hi All,

    I attached an expanded version of the original sample workbook in this thread with all the working suggestions above included. This expanded workbook contains other features not related to this thread so I won't discuss them here, but if you want to understand the details of those additonal features you can go to the following threads where they are discussed:

    Formula to selectively find the total score based on multiple criteria from 3 lists and
    Use Solver Add-in to find the highest Total Score by selecting deselecting filter lists

    My question now is about the formulas to the right of the attached SampleFreqNumsExpanded.xlsx workbook that are used to find most frequent numbers in Expanding Arrays with Multiple Criteria, under the heading "Expanding Arrays with Multiple Criteria" and more specifically about the formula in cell O21 under the heading, "Best Top Numbers Formula". That formula is an expanding array formula that is first entered into cell O21 then filled or copied down to the cells directly below O21 up to cell O29.

    Since all the 3 Top Numbers array formulas are expanding array formulas, for them to work, they must be entered with Control + Shift + Enter.

    The "Best Top Numbers Formula" in cell O21 is as follows:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So my question for all the experts here is how, preferably without adding any extra helper columns, can I limit this expanding array to ONLY capture those most frequently occurring numbers that appear 3 times or more in list1. I called the minimum number of times those most frequently occurring numbers must occur to qualify for inclusion the expanding array the Freq Threshold and that threshold number is in cell M3 which I called the range named, freqthreshold. So the list of most frequently occurring numbers must only contain numbers whose frequency of occurrence in list1 is >= freqthreshold. So how can I add this additional freqthreshold criteria to the expanding array formula above from cell O21 that is copied down to cell O29? Can anyone help with this? Thank you very much for your help.

    EDIT: I added this question to its own new thread here:
    How to Capture ONLY the most frequent numbers whose occurrence >=3 in a list?
    Attached Files Attached Files
    Last edited by globally; 01-09-2020 at 12:13 AM. Reason: Added this question to its own new thread where it was eventually solved

+ 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. [SOLVED] Index match with multiple criteria (one with a wildcard) and multiple results.
    By rachelsteele in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2019, 06:51 PM
  2. Replies: 1
    Last Post: 01-18-2019, 03:55 PM
  3. [SOLVED] Lookup to match multiple criteria and return multiple results excluding duplicates.
    By kris3012 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-13-2018, 11:06 AM
  4. Replies: 2
    Last Post: 12-16-2016, 07:58 AM
  5. [SOLVED] Index match on multiple criteria/ results
    By Burt_100 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2015, 10:40 AM
  6. [SOLVED] Index/Match function to count my criteria results once
    By superboy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-14-2014, 02:29 PM
  7. Count statement wtih multiple criteria only showing results for one criteria
    By uhlabomber in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2013, 02:47 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