+ Reply to Thread
Results 1 to 8 of 8

Index and Vlookup question (Multiple Condition)

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Index and Vlookup question (Multiple Condition)

    Hi, my excel is as below. I have excel sheet. Column A, B, C, D stand for Room No, Company, Contract No and Rental.
    Spreadsheet 1 look like this...

    A2-01 ABC C201201002 $500
    A2-03 ABC C201201003 $450
    A2-01 GGG C201201001 $350
    B2-03 GGG C201201001 $260
    B2-03 XXX C201201005 $250


    The difficult thing is each room might have 1 or more contract number and maybe more than 1 company staying. 1 company might have multiple contract. However, each contract is only attached to 1 company. For example, ABC might have Contract number C201201002 and C201201003, but these 2 contract number wont be re-used again for another company.

    NOw the problem comes, I have another spreadsheet, it have the same Column A, B and C. HOwever, without Column D. How do I use "Index" or "Vlookup" to solve my problem?

  2. #2
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Index and Vlookup question (Multiple Condition)

    Sorry, I mean i need to input the value at Column D to the other spreadsheet. I cannot just copy n paste the whole thing.

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Index and Vlookup question (Multiple Condition)

    can you try this one
    =index(D:D,match(A1&B1&C1,Sheet1!A:A&Sheet1!B:B&Sheet1!C:C,0)) -ctrl+shift+enter
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  4. #4
    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: Index and Vlookup question (Multiple Condition)

    Hi,

    When you say you have another 'spreadsheet' do you really mean that you have another Excel workbook, or is there in fact only one workbook with the data you show in one sheet and the A, B & C columns without column D in a second worksheet?

    Assuming the former and the key field is the contract number, then in column D of the second workbook enter the following formula in D1 and copy down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Change the Book1 and Sheet1 references as appropriate.
    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.

  5. #5
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Index and Vlookup question (Multiple Condition)

    Hi, i tried, but i get error. I don't know why.
    Does your formula =index(D:D,match(A1&B1&C1,Sheet1!A:A&Sheet1!B:B&Sheet1!C:C,0)) mean, "Go Down Column D, and Stop at where A1 is found in Column A, B1 Found in Column B, C1 found in Column C"?

    Also, some Contract in Spreadsheet 2 (Without Column D) didnt not appear in Spreadsheet 1 (With Column D). Can i add a "if(iserror(match......)" to your formula? And Shift+ctrl + enter? Would it be ok?

  6. #6
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Index and Vlookup question (Multiple Condition)

    What vlady post has given me some hint. But i don't know how to input the formula. I use index. But the problem is that all the value might appear more than once. And excel automatically give me the most upper search result when i use Match. I need a Double Match. match the Contract then match the Room.........

  7. #7
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Index and Vlookup question (Multiple Condition)

    Hey, anyone can tell me where is the "solve" button? My problem is solved. Thanks vlady!!!!

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Index and Vlookup question (Multiple Condition)

    Select Thread Tools from the menu above to mark the thread as solved. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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