+ Reply to Thread
Results 1 to 5 of 5

Returning row names for multiple largest values

  1. #1
    Registered User
    Join Date
    08-21-2020
    Location
    Seattle, WA
    MS-Off Ver
    Excel 16.4 for Mac
    Posts
    10

    Returning row names for multiple largest values

    I have data organized like this:

    Month Value1 Value2 Value3 Value4 Value5
    Jan 4 1 1 1 1
    Feb 2 2 0 3 1
    Mar 3 3 3 0 1
    April 3 2 2 1 0

    And I want to return a list of row names for the highest three values in any given column. So, the following results would generate:

    Value1: Jan, Mar, April
    Value2: Feb, Mar, April
    Value3: Jan, Mar, April
    Value4: Jan, Feb, April
    Value5: Jan, Feb, Mar

    As you can see by my results, order doesn't matter -- I just need the highest 3 values. In the event of a tie, it is okay to truncate the list.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,618

    Re: Returning row names for multiple largest values

    I think it could be easier to obtain by formulas if produced output would be sorted from highest to lowest (with possible truncating duplicated lowest values).
    But trying to obtain exactly what you've shown as a sample result would probably not be so easy. So I wrote a short VBA code to do it.
    Please Login or Register  to view this content.
    See sample file
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    08-21-2020
    Location
    Seattle, WA
    MS-Off Ver
    Excel 16.4 for Mac
    Posts
    10

    Re: Returning row names for multiple largest values

    Hi Kaper, thank you so much for your help, and for the tips on attaching sample data. This solution works perfectly.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Returning row names for multiple largest values

    Not sure what works on MAC 16.4 but this formula works for me
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    with the data in B2:F5 and the formula in J8 copied down. If there are ties for 3rd place, it will give all results.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    08-21-2020
    Location
    Seattle, WA
    MS-Off Ver
    Excel 16.4 for Mac
    Posts
    10

    Re: Returning row names for multiple largest values

    Thank you both for these great solutions!
    Last edited by OneEyeAskew; 10-20-2020 at 02:59 PM.

+ 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. Finding 5 largest values in a column and then returning the rows that correspond
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-24-2020, 08:03 PM
  2. Replies: 4
    Last Post: 04-04-2015, 04:24 AM
  3. Returning Max value, 2nd largest, 3rd largest, etc without duplicates
    By ARayburn in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-21-2013, 11:49 AM
  4. Replies: 3
    Last Post: 07-04-2012, 11:15 PM
  5. Replies: 3
    Last Post: 07-24-2009, 06:50 PM
  6. Excel 2003, returning 2 largest values
    By davros80 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-27-2008, 11:22 AM
  7. Returning the Nth Largest / Smallest Values in a Range
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-29-2005, 07: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