+ Reply to Thread
Results 1 to 14 of 14

Return corresponding name of max value

  1. #1
    Registered User
    Join Date
    11-04-2015
    Location
    los angeles
    MS-Off Ver
    office 2013
    Posts
    13

    Return corresponding name of max value

    As seen in the screenshot attached, I have a list of names of people in column P who have made an offer (column Q). R1:Y1 is names of people who may make an offer. R2:Y2 and below are the offers the people listed in R1:Y1 will make. In column Z I have a simple MAX formula to tell me what the highMax offer.JPGest offer is "=max(Q2:Y2)". In column AA how can I see the name of the corresponding max offer?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Return corresponding name of max value

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Return corresponding name of max value

    Agree that we need to see a sample workbook, not a pic

    Having said that, you probably want something like...
    =INDEX(P:P,match(MAX(Z:Z),Z:Z,0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-04-2015
    Location
    los angeles
    MS-Off Ver
    office 2013
    Posts
    13

    Re: Return corresponding name of max value

    Here you go!
    Attached Files Attached Files

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Return corresponding name of max value

    Not quite clearly with Last Buyer Name, but try

    =IF(B2=K2,A2,LOOKUP(2,1/(B2:J2=K2),$B$1:$J$1))
    Quang PT

  6. #6
    Registered User
    Join Date
    11-04-2015
    Location
    los angeles
    MS-Off Ver
    office 2013
    Posts
    13

    Re: Return corresponding name of max value

    Awesome... thank you bebo021999! Exactly what I was looking for!!

    Bon journée!

  7. #7
    Registered User
    Join Date
    11-04-2015
    Location
    los angeles
    MS-Off Ver
    office 2013
    Posts
    13

    Re: Return corresponding name of max value

    Could you kindly explain this part of the formula.."LOOKUP(2,1/(Q2:Y2=Z2),$Q$1:$Y$1))", I do no understand why the lookup value is 2 and the lookup value is 1/(B2:J2=K2) -- why 1/ ?

    Thank you!!

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Return corresponding name of max value

    Q2:Y2=Z2 returns TRUE where meets condition/FALSE where dont.
    1/(Q2:Y2=Z2) converts TRUE to 1 and FALSE to #DIV/0
    i.e {#DIV/0,#DIV/0,1,#DIV/0,#DIV/0}

    Lookup value 2 (or any value that >1) will look for 1 then returns corresponding value in Q1:Y1

    Hope it is clear for you.

  9. #9
    Registered User
    Join Date
    11-04-2015
    Location
    los angeles
    MS-Off Ver
    office 2013
    Posts
    13

    Re: Return corresponding name of max value

    Thank you bebo021999! I really, really appreciate your timely help and input on my questions

    This is very clear to me now, except I still do not understand how the lookup value must be >= 1... I see that if the value is <1, for example 0.5, it does not return the name if the highest offer belongs to someone in the columns R:Y.. but i do not understand the microsoft article on on the lookup function is not very helpful either

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return corresponding name of max value

    Here is another way of making the same calculation:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  11. #11
    Registered User
    Join Date
    11-04-2015
    Location
    los angeles
    MS-Off Ver
    office 2013
    Posts
    13

    Re: Return corresponding name of max value

    Thanks newdoverman! Great idea of using index & match

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return corresponding name of max value

    Thank you for the feedback.

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return corresponding name of max value

    Oops ..... duplicated message. Please delete.

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Return corresponding name of max value

    Quote Originally Posted by johnelder View Post
    This is very clear to me now, except I still do not understand how the lookup value must be >= 1... I see that if the value is <1, for example 0.5, it does not return the name if the highest offer belongs to someone in the columns R:Y.. but i do not understand the microsoft article on on the lookup function is not very helpful either
    LOOKUP syntax:

    =LOOKUP(Value, ascending_range,[lookup_range])

    Asending range, ie:

    {0,1,2,3,...}

    {" "," ",1," "}

    {#DIV/0,#DIV/0,1,#DIV/0,#DIV/0}

    but not :{0,0,1,0,0}

    in our sample file:

    =LOOKUP(any value greater than 1,{#DIV/0,#DIV/0,1,#DIV/0,#DIV/0},{"Jenny","Pete","Jack","ABC","XYZ"}) = Jack

    More example for lookup value:

    =LOOKUP(3,{0,1,2,3,5,6},{100,50,3,40,9,5}) =40


    =LOOKUP(4,{0,1,2,3,5,6},{100,50,3,40,9,5}) =40

+ 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: 2
    Last Post: 05-07-2015, 04:38 PM
  2. Double click row to return data to userform for edit then return back to sheet
    By MattRSJ in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-31-2014, 06:05 AM
  3. Replies: 12
    Last Post: 10-10-2013, 10:02 AM
  4. [SOLVED] Return value if within range, return multiple values if ranges overlap
    By cde1983 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-17-2013, 06:16 AM
  5. Replies: 4
    Last Post: 03-13-2013, 12:38 PM
  6. Replies: 6
    Last Post: 10-11-2012, 02:39 PM
  7. Search...Return...give info based on the return address
    By deek1004 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-11-2012, 03:36 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