+ Reply to Thread
Results 1 to 4 of 4

Match two columns in one file with two from another, returning a third column from file 2

  1. #1
    Registered User
    Join Date
    07-25-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    2

    Match two columns in one file with two from another, returning a third column from file 2

    Hi Everyone,

    I have been trying to figure out different combinations of INDEX, MATCH, IF, AND, etc. to get a solution with no success and would really appreciate some help.

    Basically, I have a list of first and last names (in separate columns) in one file and need to look up the email for that person in another file, matching on the first and last name columns. I attached an example of my data with the two sheets representing the two files and pasted a copy here as well.

    File 1
    First Name Last Name Email
    x x Need to lookup
    y y Need to lookup
    z z Need to lookup

    File 2
    First Name Last Name Email
    a a [email protected]

    z z [email protected]


    Any ideas on how to do this?

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Match two columns in one file with two from another, returning a third column from fil

    Try this...

    Data Range
    A
    B
    C
    1
    First Name
    Last Name
    Email
    2
    x
    x
    3
    y
    y
    4
    z
    z


    This array formula** entered in C2 and copied down:

    =INDEX('File 2'!C$2:C$9,MATCH(1,('File 2'!A$2:A$9=A2)*('File 2'!B$2:B$9=B2),0))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    07-25-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    2

    Re: Match two columns in one file with two from another, returning a third column from fil

    This worked perfect, thanks a lot!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Match two columns in one file with two from another, returning a third column from fil

    You're welcome. Thanks for the feedback!

+ 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. [SOLVED] How can I match data fields in two columns on one file with those in another file?
    By geomatics in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-21-2014, 11:04 PM
  2. Replies: 0
    Last Post: 10-29-2013, 02:05 PM
  3. Replies: 3
    Last Post: 04-16-2013, 01:44 PM
  4. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  5. [SOLVED] How to Copy Column A from File 1 to Column D of File 2 without keeping File 1 open
    By eggcel in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-12-2013, 02:38 AM
  6. Returning Data from 3rd Column When 2 columns match
    By stephR82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 07:58 AM
  7. [SOLVED] Read whole file,Match the headers based on specific condition & write to text file
    By macromaniac in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-07-2011, 06:37 AM

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