+ Reply to Thread
Results 1 to 5 of 5

Finding the top five numbers in a column that has 2 seperate ranges of numbers/data sets

  1. #1
    Registered User
    Join Date
    05-07-2014
    Location
    NC USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Finding the top five numbers in a column that has 2 seperate ranges of numbers/data sets

    I have a column that has totals and losses in the same column. I need to find the top 5 losses in the column which are between .5 and 75. The totals are all over 90 in the same column. I also need to pull a name to go with the number that is in different row and column and then put the results in a column that spans 5 rows down. I know I can use the max function to get the top/highest number, but not sure how to get the next 4 and then make them appear in a column starting on for ex: row 23 and the next 4 appear down 24, 25, 26, 27. I am extremely new to excel fucntions and have exhausted my searches of forums trying to find exactly what I need. Any help is appreciated.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Finding the top five numbers in a column that has 2 seperate ranges of numbers/data se

    See if my attached sheet does what you are asking...

    - Moo
    Attached Files Attached Files
    Last edited by Moo the Dog; 05-07-2014 at 08:56 PM.

  3. #3
    Registered User
    Join Date
    05-07-2014
    Location
    NC USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Finding the top five numbers in a column that has 2 seperate ranges of numbers/data se

    Moo,

    That is exactly what I needed! Thank you! I know there is a way to make the field populate with a "0" until data is actually written into cells in array to keep the error from showing up. I will look farther to see if I can figure this one out. I also want to understand your formula a little better. =LARGE(Array,X) I saw that function but never knew we could do with it what you did. I understand the range, but not sure how you incorporated the rows + IFCOUNT to get the value of x. Going to look at it some more. I will finish up the code you gave me as I have 6 different weeks I need to apply this too and then I will need to also figure out how to pull a name from another cell and carry that into the number so I know "Who" Lost this much weight. will attach the sheet and follow up with that info shortly

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Finding the top five numbers in a column that has 2 seperate ranges of numbers/data se

    Explaining the formula =LARGE(ARRAY, X):

    =LARGE($A$3:$A$17,ROWS($C$23:$C23)+COUNTIF($A$3:$A$17,">"&90))

    The ROWS($C$23:$C23) part handles incrementing from 1 to 2 to 3, etc. as you fill down. That way you don't have to manually change the X-Value from 1 to 2 to 3... As you fill down the formula changes to ROWS($C$23:$C24) [2], then in the next row becomes ROWS($C$23:$C25) [3], etc.

    The COUNTIF($A$3:$A$17,">"&90) portion of the formula is used to account for the totals within the column that are greater than 90. So, in the given array, there are two numbers greater than 90, so in the first row of results it adds 1 + 2, which will return the 3rd largest number in the array, which is actually the largest 'non-total' number. In the second row, the formula returns 2 + 2, which is the 4th largest number in the entire array, which is really the 2nd largest non-total value.

    You mention that you are also looking to match a name value to the loss value, which should be fairly easy to do... UNLESS there are duplicate results. For instance, if the 3rd largest and 4th largest numbers end up being the same, when you do an INDEX/MATCH or VLOOKUP search, it will only return the corresponding value for the first time that number appears, which will lead to incorrect results. So it will be interesting to see how it works with your data.

    Hope that helps!

    - Moo

  5. #5
    Registered User
    Join Date
    05-07-2014
    Location
    NC USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Finding the top five numbers in a column that has 2 seperate ranges of numbers/data se

    Moo,

    Thank you for the explanation. I had figured out the ROWS increment and thought that was pretty slick for copying down and it worked flawlessly as that is exactly what I did, however the countif and the > had me a little confused. I think I understand that now after your detail explanation. Again thank you!

    You are correct on the Name Value. The Name value would run into issues as we commonly have duplicate losses for the same week. I just may have to do without that. I also have the issues where I need "0" or empty cell to show up in a cell that has a formula that comes up with XXXX, #NUM! or the div/0 error while it is waiting on data to be entered into a cell. This really is my first spreadsheet that I have used any functions or formulas other than autosum, so it has been a challenge. I would like to attach it here and let you look it over and give me some pointers. It's mostly finished, with the only thing left to do is find the top 10 overall losers. If you don't have time, I completely understand and appreciate greatly what you have helped me with so far.

    Richard
    Attached Files Attached Files

+ 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. How do I select and copy ranges of indefinite numbers of rows based on sets of criteria?
    By patricia hatton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2013, 10:11 AM
  2. Replies: 0
    Last Post: 01-23-2012, 09:36 AM
  3. Replies: 2
    Last Post: 02-17-2011, 02:22 PM
  4. Finding streaks in large sets of numbers
    By Jish in forum Excel General
    Replies: 4
    Last Post: 02-14-2010, 08:48 PM
  5. Replies: 1
    Last Post: 04-10-2008, 11:47 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