+ Reply to Thread
Results 1 to 5 of 5

Need to match two columns and return a third column value from a table

  1. #1
    Registered User
    Join Date
    02-12-2014
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Need to match two columns and return a third column value from a table

    I have two columns in which I want to match BOTH columns to two columns in a table, and then VLOOKUP return the value from a third column in the table. But I'm not sure if this is possible...

    I have attached an example:

    On the left, I have two columns of data and the area where I want to have the VLOOKUP. On the right side is the table with 3 columns of data. I want to have A2 and B2 BOTH match to something in columns H and I AND return the value from column J. So if we look in the data, matching A21 & B21 to H & I the value should be Northwest Allied Physicians, but if we only have the one value (like normal VLOOKUP), this doesn't work and it returns OB.

    So is there a way to have the VLOOKUP check and match BOTH values before it returns a value?

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Need to match two columns and return a third column value from a table

    D2:

    Non-Array Formula

    =LOOKUP(2,1/(($H$2:$H$22=B2)*($I$2:$I$22=C2)),$J$2:$J$22)


    or

    Array Formulas

    =INDEX($J$2:$J$22,MATCH(B2&C2,$H$2:$H$22&$I$2:$I$22,0))

    =INDEX($J$2:$J$22,MATCH(B2,IF($I$2:$I$22=C2,$H$2:$H$22),0))

    (array formulas are confirmed with Ctrl+Shift+Enter to exit the cell)
    Last edited by daffodil11; 02-12-2014 at 01:22 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    02-12-2014
    Location
    Tucson, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Need to match two columns and return a third column value from a table

    Thank you SO much daffodil11. This was perfect...I could have tried all day and not have been able to do this!!

    Really appreciate your quick response too!

  4. #4
    Registered User
    Join Date
    06-01-2017
    Location
    NY,NY
    MS-Off Ver
    2016
    Posts
    1

    Re: Need to match two columns and return a third column value from a table

    Hi Daffodil11,
    Would it be possible for you to explain the Lookup formula.
    I can't wrap my head around how this works.

    thanks!

  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
    52,938

    Re: Need to match two columns and return a third column value from a table

    dwhiskee welcome to the forum

    I know this is really just asking how it works, but unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 12-16-2013, 04:02 AM
  2. Replies: 20
    Last Post: 04-15-2013, 01:06 PM
  3. Replies: 3
    Last Post: 05-24-2012, 10:10 AM
  4. Match 2 columns in 2 sheets and return the 3rd column
    By swadson in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-16-2011, 04:36 PM
  5. Replies: 6
    Last Post: 03-01-2011, 06:23 PM

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