+ Reply to Thread
Results 1 to 8 of 8

vlookup based on 2 condition

  1. #1
    Forum Contributor
    Join Date
    12-18-2008
    Location
    Slovakia
    MS-Off Ver
    Office 2016
    Posts
    162

    vlookup based on 2 condition

    Hi,
    can you help me?

    i looking for function, which will give me a results if its the person good , bad and other (Y). It will look based on column A, but if will be more equal names in this column, it looks in the column surname (B) and return value from column (Y) in this row. But it can be more equal column B.

    Here is an example:
    Results what i want are in Z1,Z2,Z3

    X Y Z
    1 sue doe good
    2 joe bond very good
    3 mark no bad

    SOURCE table
    A B C
    1 john doe good
    2 joe black bad
    3 sue doe good
    4 mark black not bad
    5 joe bond very good
    6 mark no bad
    7 kat doe bad

    How can i do this? Maybe with using vlookup and if?
    thx
    Last edited by danusko; 01-28-2009 at 09:43 AM.

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

    Re: vlookup based on 2 condition

    Try:

    =Index($C$2:$C$100,Match(1,($A$2:$A$100=X1)*($B$2:$B$100=Y1),0))

    adjust ranges to suit.

    This formula must be confirmed with CTRL+SHIFT+ENTER not just ENTER, you will see { } brackets appear... then copy down.
    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 Contributor
    Join Date
    12-18-2008
    Location
    Slovakia
    MS-Off Ver
    Office 2016
    Posts
    162

    Re: vlookup based on 2 condition

    it works in 2 cases - row 1 and 2, but in row 3 give me error N/A
    why?
    this is the code what i insert
    Please Login or Register  to view this content.

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

    Re: vlookup based on 2 condition

    It needs to be an exact match...

    Check that none of the cells in either table have extra spaces or mispellings...

    Also, did you confirm the formula with the CTRL, SHIFT and ENTER keys... did you see {} brackets appear?

  5. #5
    Forum Contributor
    Join Date
    12-18-2008
    Location
    Slovakia
    MS-Off Ver
    Office 2016
    Posts
    162

    Re: vlookup based on 2 condition

    sorry...my bad...i have bad value in column...
    it works great.
    thanke you very much...

  6. #6
    Registered User
    Join Date
    04-06-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: vlookup based on 2 condition

    I'm having a same problem , i.e to link two different condition in two different sheet as follows:-


    A B C
    Mark No Qty Code
    1 1002 1.55 M01A
    2 1003 2.96 M02A
    3 1004 0.56 M03A
    4 1002 2.81 M01A
    5 1002 2.87 M02A
    6 1003 7.01 M02A
    7 1004 1.04 M03A
    .. ... ... ...


    Sheet-1 (Data sheet)

    and the ans. will be in sheet-2 considering below condition:-

    A B C
    M01A M02A M03A
    Mark No
    1002 1.55+2.81 (under code M01A in Column "A", and 2.87 under code no M02A in col. "B"
    1003 2.96+7.01 (under code no M02A in "B" column
    1004 0.56+1.04 (under code no M03A in "C" column

    Sheet-2 (result will be like this)

    Please help me to find out any formula either 'vlookup' or 'sum-if' or any easy/suitable...

    advance thanks

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: vlookup based on 2 condition

    Welcome to the forum sum_kon.
    Unfortunately you've posted in a thread that's over 3 years old.
    Please read the Forum Rules and then start your own thread, referring to this one if you think it's relevant.

  8. #8
    Registered User
    Join Date
    04-06-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: vlookup based on 2 condition

    thank for the information... although i'm going to read rules, but it will be highly appreciable if u can help me to find the right thread...

+ 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