+ Reply to Thread
Results 1 to 7 of 7

Extract column label based on MAX and MIN values

  1. #1
    Registered User
    Join Date
    10-10-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    8

    Extract column label based on MAX and MIN values

    Hi
    Any ideas as to how can i extract the column label for the MAXs and MINs. It's crucial to extract the label names of ALL columns that scored the maximum value (or minimum).
    For instance Cell I2 shows V, SS because those two columns contain the MAX scores in the range (similar for MIN.. R, CI).
    The actual data contains several hundred rows and the data is grouped in 3 rows per person.
    Luis
    Attached Files Attached Files
    Last edited by luis33; 10-15-2010 at 02:41 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Extract column label based on MAX and MIN values

    What are the Max and Mins based on?

    I can't match your results, what am I missing?

    See Attached
    Attached Files Attached Files
    Last edited by Marcol; 10-13-2010 at 10:23 PM.

  3. #3
    Registered User
    Join Date
    10-10-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Extract column label based on MAX and MIN values

    Marcol - thanks for looking into this and apologies, there is an error in the results I am after.
    For person 1, the scores are range B2:F4. The max value there is 15 and only one entry should appear (CI), for MINs, the min value is 8 and 2 columns have that value for person 1 -> R and CI, both should appear.
    Person 1: Max -> CI and Min -> R, CI
    Person 2: Max -> R and Min -> R, GSP, SS
    Person 3: Max -> R and Min -> R

    Cheers
    Luis

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Extract column label based on MAX and MIN values

    Luis, you might want to consider a User Defined Function (VBA) for this

    Please Login or Register  to view this content.
    the above, stored in a module, would be called from a cell along the lines of:

    Please Login or Register  to view this content.
    the above is designed to account for possibility that "persons" may not always be listed in a contiguous range within the first criteria range
    Last edited by DonkeyOte; 10-14-2010 at 08:33 AM.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Extract column label based on MAX and MIN values

    Hi Don, you've beaten me to it once again! I'll get this formula thing one day!

    For what it's worth luis33, here's my tuppence worth using helper columns and formulae.

    1/. In A2
    Please Login or Register  to view this content.
    Drag Down as required.

    2/. In I2
    Please Login or Register  to view this content.
    Drag Across to M2.

    3/. In O2
    Please Login or Register  to view this content.
    Drag Across to S2.

    4/. In U2
    Please Login or Register  to view this content.
    Drag Across to V2.

    5/. In X2
    Please Login or Register  to view this content.
    Drag Across to Y2.

    6/. Drag all Formulae Down as required.

    Important
    I have added a column to enter actual names.
    Don't delete column A, or column B, and don't add any more columns before column H

    Use the grouping buttons to hide/show columns to step through the steps, and hide the columns to clearly see the results.

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Registered User
    Join Date
    10-10-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Extract column label based on MAX and MIN values

    Thanks guys - both solutions by DonkeyOte and Marcol's solved my problem - Cheers
    Luis

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Extract column label based on MAX and MIN values

    On behalf of all, glad to have been of help.

+ 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