+ Reply to Thread
Results 1 to 4 of 4

Trouble with using VLOOKUP + MATCH and MAX commands to return a string per a max

  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Champaign
    MS-Off Ver
    Excel 2010
    Posts
    4

    Trouble with using VLOOKUP + MATCH and MAX commands to return a string per a max

    I am currently building a risk report model and have no problem utilizing VLOOKUP with MATCH and MAX to return the greater of two inputs in two categories. However when I apply the code to a logic prgoression so that the max can be returned as a string for another report tab, the code is simply returning the string corresponding to one column vectors input, rather than establishing the max of the two and returning the string for the max. The code is as follows ( I would greatly appreciate some help, Thanks) :

    =IF(VLOOKUP(B4,database!$A$3:$AG$2000,MAX((MATCH("Risk Impact, After Control, Financial, 1 Yr",database!$2:$2,0)),MATCH("Risk Impact, After Control, Non-Financial, 1 Yr",database!$2:$2,0)))=5,"VH",IF(VLOOKUP(B4,database!$A$3:$AG$2000,MAX((MATCH("Risk Impact, After Control, Financial, 1 Yr",database!$2:$2,0)),MATCH("Risk Impact, After Control, Non-Financial, 1 Yr",database!$2:$2,0)))=4,"H",IF(VLOOKUP(B4,database!$A$3:$AG$2000,MAX((MATCH("Risk Impact, After Control, Financial, 1 Yr",database!$2:$2,0)),MATCH("Risk Impact, After Control, Non-Financial, 1 Yr",database!$2:$2,0)))=3,"M",IF(VLOOKUP(B4,database!$A$3:$AG$2000,MAX((MATCH("Risk Impact, After Control, Financial, 1 Yr",database!$2:$2,0)),MATCH("Risk Impact, After Control, Non-Financial, 1 Yr",database!$2:$2,0)))=2,"L","VL"))))

    This is only reporting from the "Risk Impact, After Control, Non-Financial, 1 Yr" vector rather than establishing the max with the "Risk Impact, After Control, Financial, 1 Yr" vector

    Daniel

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Trouble with using VLOOKUP + MATCH and MAX commands to return a string per a max

    Hi,

    Very difficult to assist without seeing your request in the context of its workbook. Please upload. In addition clearly show what you expect the result to be for all input permuataions - and importantly a description as to how you arrive at your answer.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Trouble with using VLOOKUP + MATCH and MAX commands to return a string per a max

    wyczolko,

    I'm pretty sure this is what you want:
    =INDEX({"VL","L","M","H","VH"},MAX(VLOOKUP(B4,database!$A$3:$AG$2000,MATCH("Risk Impact, After Control, Financial, 1 Yr",database!$2:$2,0),FALSE),VLOOKUP(B4,database!$A$3:$AG$2000,MATCH("Risk Impact, After Control, Non-Financial, 1 Yr",database!$2:$2,0),FALSE)))
    Hope that helps,
    ~tigeravatar

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

  4. #4
    Forum Contributor
    Join Date
    08-04-2011
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    109

    Re: Trouble with using VLOOKUP + MATCH and MAX commands to return a string per a max

    If I understand your formula correctly, your Max(Match()) is simply trying to establish which column header occurs last in the range. Since the columns are not dynamic, it will always return the same value. If you state that your results are only reporting from "Risk Impact, After Control, Non-Financial, 1 Yr", I can only assume that it occurs after "Risk Impact, After Control, Financial, 1 Yr" in your order of columns headers. I believe what you intend to do is the vlookup for each column prior to determining the max. To do this you will need to pull the max function outside the vlookup function, and vlookup both columns.

    Please Login or Register  to view this content.

+ 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