+ Reply to Thread
Results 1 to 10 of 10

Return a name from two columns of data

  1. #1
    Registered User
    Join Date
    10-14-2011
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    25

    Question Return a name from two columns of data

    I'm trying to figure out a formula I can use that will return a name based on two sets of data. I need the name that has the highest number AND the greater percentage. I attached a screenshot of what I need. In this case, in cell D3 I need it to say C (since it has the highest amount in column B, AND the higher percentage between the two that have the highest amount). I just can't figure out how to return the higher percentage, since it's not necessarily the highest from the set.
    Attached Images Attached Images
    Last edited by geddes_3; 10-14-2011 at 12:44 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return a name from two columns of data

    Try:

    =INDEX(A1:A5,MATCH(1,(MAX(B1:B5)=B1:B5)*(C1:C5=MAX(IF(B1:B5=MAX(B1:B5),C1:C5))),0))

    confirmed with CTRL+SHIFT+ENTER not just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Return a name from two columns of data

    Here you go.
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    10-14-2011
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Return a name from two columns of data

    I tried that formula but didn't get the desired result. Ideally I'd like to copy the formula through all cells in column D, but when I did that it returned a different name in cells D4 and D5. Is there a way to have it only return one name in the appropriate cell (with the same formula in each cell in column D?). Thanks for your help

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Return a name from two columns of data

    Like this?
    Attached Images Attached Images

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return a name from two columns of data

    So are you trying to do a top 5 or something like that?

  7. #7
    Registered User
    Join Date
    10-14-2011
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Return a name from two columns of data

    NBVC - Yeah it is like a top 5, but I have like 100 different names and only need 1 name returned.

    Andrew-R - I realized that I actually don't need to copy the formula through all the cells, sorry about that.

    I'm going to try those formulas again and see if it works. Thanks again

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return a name from two columns of data

    I suggest we use a helper column to rank the numbers first..

    so in D1:

    =RANK($B1,$B$1:$B$5)+SUMPRODUCT(--($B$1:$B$5=$B1),--($C1<$C$1:$C$5))

    copied dow.

    Then in E1:

    =INDEX($A$1:$A$5,MATCH(ROWS($A$1:$A1),$D$1:$D$5,0))

    copied down to extract the corresponding letters from column A

    adjust ranges to suit.

  9. #9
    Registered User
    Join Date
    10-14-2011
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Return a name from two columns of data

    Brilliant! That did it, thanks so much

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return a name from two columns of data

    You are welcome.

    Please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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