+ Reply to Thread
Results 1 to 5 of 5

Matching data in two sheets and then returning extra data

  1. #1
    Registered User
    Join Date
    04-08-2009
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    16

    Matching data in two sheets and then returning extra data

    Hi!

    I have two sheets in a workbook. In Sheet 1 I need to match the data in Column G plus the data in Column F to the data in Column C in Sheet 2. Any matches then need to return the data that is in Column A on Sheet 2 to Column J on Sheet 1.

    e.g.

    Sheet 1
    Column F - First Name
    Column G - Surname
    Column J - (need to insert ID from Sheet 2)

    Sheet 2
    Column A - ID number
    Column B - [Not important]
    Column C - Surname, First Name


    So Column J in Sheet 1 needs to look up the data in Column G (Surname) then in Column F (First Name) in Sheet 1, then look for the same data in Column C (Surname, First Name) of Sheet 2 and then return the data in Column A Sheet 2 (ID Number) for those matches in Column J, Sheet 1 e.g. Sheet 1 Column F is 'Peter', Column G is 'Smith'; find 'Smith, Peter' in Sheet 2, Column C, and then look for his ID in Column A , Sheet 2. This ID number should then be returned to Column J in Sheet 1 (for same Peter Smith).

    I hope that makes sense! I have no idea how to go about it though. I presume I need VLOOKUP but am stumped beyond that. Any help much appreciated!
    Last edited by hpofql; 06-07-2010 at 09:12 AM. Reason: To make clearer

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Matching data in two sheets and then returning extra data

    is it always surname,lastname on sheet 2?
    and no extra spaces
    then try in j2
    =INDEX(Sheet2!A:A,MATCH(G2&","&F2,INDEX(Sheet2!C:C,0),0))
    Last edited by martindwilson; 06-07-2010 at 09:20 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    04-08-2009
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    16

    Re: Matching data in two sheets and then returning extra data

    Yes, it is always surname, lastname in Column C on Sheet 2 but with a space between the comma and the lastname (eg. Smith, Peter)

    Thank you for trying to help but, alas, this did not work. I haven't come across INDEX before so will look into this as it looks it might be useful.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Matching data in two sheets and then returning extra data

    ok put a space in after the comma in this bit G2&", "&F2 (ps where is Englad)
    Last edited by martindwilson; 06-07-2010 at 10:58 AM.

  5. #5
    Registered User
    Join Date
    04-08-2009
    Location
    England
    MS-Off Ver
    Excel 2013
    Posts
    16

    Re: Matching data in two sheets and then returning extra data

    Thank you so much! That worked. I'll have a good look at that and see if I can figure out what it is doing. Very much appreciated (and have corrected my typo, thank you).

+ 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