+ Reply to Thread
Results 1 to 11 of 11

Formula to Return Specific Ranges of Numbers in Order of Frequency

  1. #1
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Smile Formula to Return Specific Ranges of Numbers in Order of Frequency

    Hello all! I'm back again with a new conundrum.

    I have a variety of numbers in cell range P2:S14. Some of these numbers show up more than once.

    I would like cell U2 to return the most frequently occurring number, from 1-9, from the above-designated range. In cell U3, it would be the 2nd most frequently occurring number, from 1-9 in, that range, etc.

    I need to continue this pattern in cell V2 for #'s 10-19, W2 for #'s 20-29, and so on and so forth.

    So let's say the number 3 shows up 4 times in the P2:S14 range, and the number 7 shows up 3 times. Cell U2 would populate the number 3 while Cell U3 populates the number 7.

    I hope I've painted this clearly enough. Thank you in advance for your help.
    Last edited by runelady; 10-15-2016 at 03:33 PM.

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

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Hi runelady,

    See the attached to see if this is the answer you are looking for.
    Countif in Range.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Quote Originally Posted by MarvinP View Post
    Hi runelady,

    See the attached to see if this is the answer you are looking for.
    Attachment 484910
    It's close, but instead of returning the number of occurrences, it produces the number which appears most frequently, followed by the second most frequent in the 1-9, 10-19, 20-29, etc. range.

    I have attached a screenshot. The formula does not exist where the #3 appears under the "1's" column. I typed that in because it's just obvious that 3 repeats more than any other single digit number.
    Example.png
    Last edited by runelady; 10-15-2016 at 04:00 PM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    You have edited your post while I was away having a delicious steak.... So. I think this is the answer to your original Q. It may NOT be the answer to your current Q, 'cos I'm not sure what you want. so take a look and then explain IN A REPLY TO THIS THREAD (not by amending post 1 again, or starting a new thread).
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Quote Originally Posted by Glenn Kennedy View Post
    You have edited your post while I was away having a delicious steak.... So. I think this is the answer to your original Q. It may NOT be the answer to your current Q, 'cos I'm not sure what you want. so take a look and then explain IN A REPLY TO THIS THREAD (not by amending post 1 again, or starting a new thread).
    Okay, I think we're getting somewhere. Having some issues with row 2 and the 50's, (40's is N/A, but there are no 40's in there).

    Example2.png

  6. #6
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    I think I figured out the issue with the 2nd row. I can't get the 50's to populate though. I think there may not be multiples of the 50's, which is why it's not populating. I think this works.
    Last edited by runelady; 10-15-2016 at 06:40 PM.

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

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Hi,

    Here is another answer using an additional table.
    Countif in Range try 2.xlsx

  8. #8
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Great! Thank you!

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

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Here's another one.

    This will only return multi-modal numbers (numbers that appear at least twice).

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    1
    12
    20
    30
    1-9
    10-19
    20-29
    30-39
    2
    1
    13
    21
    31
    7
    13
    23
    34
    3
    2
    13
    23
    32
    1
    16
    25
    4
    4
    13
    23
    33
    5
    26
    5
    5
    13
    24
    34
    6
    5
    15
    25
    34
    7
    6
    16
    25
    34
    8
    7
    16
    26
    35
    9
    7
    18
    26
    36
    10
    7
    19
    27
    38
    11
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----


    This array formula** entered in F2:

    =IFERROR(MODE(IF(ISNA(MATCH($A$1:$D$10,F$1:F1,0)),IF($A$1:$D$10>=--SUBSTITUTE(LEFT(F$1,2),"-",""),IF($A$1:$D$10<=--SUBSTITUTE(RIGHT(F$1,2),"-",""),$A$1:$D$10)))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to I2 then down until you get a row full of blanks.

    I have the numbers sorted just to make it easier to see what results you should expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    Quote Originally Posted by Tony Valko View Post
    Here's another one.

    This will only return multi-modal numbers (numbers that appear at least twice).

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    1
    12
    20
    30
    1-9
    10-19
    20-29
    30-39
    2
    1
    13
    21
    31
    7
    13
    23
    34
    3
    2
    13
    23
    32
    1
    16
    25
    4
    4
    13
    23
    33
    5
    26
    5
    5
    13
    24
    34
    6
    5
    15
    25
    34
    7
    6
    16
    25
    34
    8
    7
    16
    26
    35
    9
    7
    18
    26
    36
    10
    7
    19
    27
    38
    11
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    ----


    This array formula** entered in F2:

    =IFERROR(MODE(IF(ISNA(MATCH($A$1:$D$10,F$1:F1,0)),IF($A$1:$D$10>=--SUBSTITUTE(LEFT(F$1,2),"-",""),IF($A$1:$D$10<=--SUBSTITUTE(RIGHT(F$1,2),"-",""),$A$1:$D$10)))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy across to I2 then down until you get a row full of blanks.

    I have the numbers sorted just to make it easier to see what results you should expect.
    Thank you, Tony!

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

    Re: Formula to Return Specific Ranges of Numbers in Order of Frequency

    You're welcome!

+ 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: 3
    Last Post: 01-21-2016, 02:23 PM
  2. [SOLVED] Group numbers into workable ranges in order to run a pivot table (days taken to update)
    By Bunny Screen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2014, 09:14 AM
  3. excel return all cells containing in order if other cell contains specific text
    By vio.violeta in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-17-2014, 08:52 AM
  4. Replies: 3
    Last Post: 02-11-2014, 05:36 PM
  5. Copy / delete ranges in specific order
    By MKrop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2013, 03:51 AM
  6. Analyzing the frequency of occurance of specific numbers?
    By tam232 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2012, 07:49 PM
  7. List numbers by order of frequency?
    By SubjectEgo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2008, 11:16 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