+ Reply to Thread
Results 1 to 5 of 5

VLookUp with 2 cell criteria

  1. #1
    Registered User
    Join Date
    07-30-2009
    Location
    St Catharines, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    6

    VLookUp with 2 cell criteria

    As the title says what I need to do is match a part number (col A) and a purchase order (col B) on sheet 1 to sheet 2 and return a delivery date from sheet 2

    I know that a vlookup will only look at one cell as it's "lookup_value" and unfortunatley part numbers have multiple PO's and PO's have multiple part numbers.

    Any ideas?

  2. #2
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: VLookUp with 2 cell criteria

    What about creating a concatenated column on both pages? The page where you're doing the vlookup, and the one that you're referencing?

    Just insert column C, use
    =Concatenate(A2,B2)
    Into C2, and fill down


    Then just use the Vlookup based on Column C...


    Could always hide row C afterwards, or throw it off to the end of the table, row IV if you want.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: VLookUp with 2 cell criteria

    You'll need to insert a column before your Part Number on Sheet 2 and concatenate your part # and Pur Order in those cells. You can hide the column when you are done.
    Please Login or Register  to view this content.
    Then your lookup on Sheet1 (assuming delivery date is in column D)
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

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

    Re: VLookUp with 2 cell criteria

    A sample sheet makes this much easier to demonstrate, but you can try this with no helper column and see if it works for you. Switching from VLOOKUP to INDEX/MATCH makes this easier and more robust:

    =INDEX(Sheet2!C$1:$C$100, MATCH(A2 & "-" & B2, INDEX(Sheet2!$A$1:$A$100 & "-" & Sheet2!$B$1:$B$100, 0), 0))

    Translates to:
    =INDEX(RangeofDates, MATCH(Prt# & "-" & PO#, INDEX(RangofPrt#s & "-" & RangeofPO#s, 0), 0))
    Last edited by JBeaucaire; 07-30-2009 at 11:44 AM.
    _________________
    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!)

  5. #5
    Registered User
    Join Date
    07-30-2009
    Location
    St Catharines, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VLookUp with 2 cell criteria

    Looks like it should work. I think it is about my best solution.

    thanks for your help.

+ 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