+ Reply to Thread
Results 1 to 9 of 9

Vlookup but with 3 possible col_index_num to choose

  1. #1
    Registered User
    Join Date
    03-14-2013
    Location
    MALAYSIA
    MS-Off Ver
    Excel 2016
    Posts
    16

    Vlookup but with 3 possible col_index_num to choose

    Hi there,

    This is my first post of question:

    I am trying to use a Vlookup formula with a 3 possible col_index_num depending on the value of another column in a spreadsheet. Attached is my workbook with sheet 1 & 2. I am trying to put the vlookup in column D with the 3 possible col_index_num in sheet 2 - Column C, D or E.

    Please help
    Attached Files Attached Files

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Vlookup but with 3 possible col_index_num to choose

    =VLOOKUP(B2,Sheet2!$A$2:$E$8,(Sheet1!C2="MAXIM")*3+(Sheet1!C2="DARIOS")*4+(Sheet1!C2="CELESTICA")*5,FALSE)


    see attached
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Vlookup but with 3 possible col_index_num to choose

    or you can use index/match
    =INDEX(Sheet2!$C$2:$E$8,MATCH(B2,Sheet2!$A$2:$A$8,0),MATCH(C2,Sheet2!$C$1:$E$1,0))
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,313

    Re: Vlookup but with 3 possible col_index_num to choose

    Cell D2: =INDEX(Sheet2!$B$2:$E$8, MATCH($B2,Sheet2!$A$2:$A$8,0),MATCH($C2,Sheet2!$B$1:$E$1,0)) ... and drag down


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    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
    53,048

    Re: Vlookup but with 3 possible col_index_num to choose

    Hi and welcome to the forum

    Try this, copied down...
    =INDEX(Sheet2!$A$1:$E$8,MATCH(Sheet1!$B2,Sheet2!$A$1:$A$8,0),MATCH(Sheet1!$C2,Sheet2!$A$1:$E$1,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

  6. #6
    Registered User
    Join Date
    03-14-2013
    Location
    MALAYSIA
    MS-Off Ver
    Excel 2016
    Posts
    16

    Re: Vlookup but with 3 possible col_index_num to choose

    Thank you all for your helpful information. Learned a few ways to solve my problems. Really appreciate the input from all of you.

  7. #7
    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
    53,048

    Re: Vlookup but with 3 possible col_index_num to choose

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    03-14-2013
    Location
    MALAYSIA
    MS-Off Ver
    Excel 2016
    Posts
    16

    Re: Vlookup but with 3 possible col_index_num to choose

    Sorry for that. I have done what needed to be done accordingly.

    The problems has been solved and Thank you everybody.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,313

    Re: Vlookup but with 3 possible col_index_num to choose

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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