+ Reply to Thread
Results 1 to 5 of 5

I need a formula that shows the header value which matches the maximum value in a row

  1. #1
    Registered User
    Join Date
    10-17-2020
    Location
    Brazil
    MS-Off Ver
    2007
    Posts
    2

    I need a formula that shows the header value which matches the maximum value in a row

    Hi all! I am new here and I am pretty new to excel too, so this question might be foolish for some and I am sorry for that.

    I am creating a spreadsheet with the grades of students in each subject. I added a column where it shows the highest grade of each student using the formula MAX.

    But I want to know in which subject that student got her/his highest grade.
    I am attaching the exemple and I added the information that I am looking for manually.

    Thank you very much!
    Attached Files Attached Files
    Last edited by anabmcosta; 10-17-2020 at 02:09 PM.

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

    Re: I need a formula that shows the header value which matches the maximum value in a row

    Slight change of result layout:

    =IFERROR(INDEX($2:$2,SMALL(INDEX(($C3:$F3<>$G3)*10^10+COLUMN($C3:$F3),0),COLUMNS($H:H))),"")

    copied across and down. If you MUST have tied subjects in the same cell, you will need either a VBA-based UDF or a helper column. Your choice!!
    Attached Files Attached Files
    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

  3. #3
    Registered User
    Join Date
    10-17-2020
    Location
    Brazil
    MS-Off Ver
    2007
    Posts
    2

    Re: I need a formula that shows the header value which matches the maximum value in a row

    Thanks a lot. It works!

  4. #4
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: I need a formula that shows the header value which matches the maximum value in a row

    Hi
    Please try this in H3 and down (This can bring up to 4 subjects in a cell) :

    =INDEX($A$2:$F$2,,AGGREGATE(14,6,((COLUMN($C:$F))/(RANK($C3:$F3,$C3:$F3)=1)),1))&IFERROR(","&INDEX($A$2:$F$2,,AGGREGATE(14,6,((COLUMN($C:$F))/(RANK($C3:$F3,$C3:$F3)=1)),2)),"")&IFERROR(","&INDEX($A$2:$F$2,,AGGREGATE(14,6,((COLUMN($C:$F))/(RANK($C3:$F3,$C3:$F3)=1)),3)),"")&IFERROR(","&INDEX($A$2:$F$2,,AGGREGATE(14,6,((COLUMN($C:$F))/(RANK($C3:$F3,$C3:$F3)=1)),4)),"")

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

    Re: I need a formula that shows the header value which matches the maximum value in a row

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Vlookup for maximum matches
    By Prascena in forum Excel General
    Replies: 1
    Last Post: 03-03-2019, 10:30 PM
  2. Need the Maximum Output as Header
    By sriku in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-09-2014, 01:52 PM
  3. Replies: 1
    Last Post: 10-05-2013, 03:35 PM
  4. lookup formula to return data where column header matches
    By tim-harrison in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-06-2013, 12:58 AM
  5. Cell Data Header Only Shows Last Line of Multi-lined Cell Data Header
    By Jrub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2012, 05:40 PM
  6. [SOLVED] Header of Maximum value formula
    By vij8y in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-17-2012, 03:44 PM
  7. Drop down list that only shows matches to what is typed
    By Andrew-Mark in forum Excel General
    Replies: 1
    Last Post: 01-21-2009, 06:18 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