+ Reply to Thread
Results 1 to 16 of 16

Combining Separate Tables With Multiple Values

  1. #1
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Combining Separate Tables With Multiple Values

    Here's my issue.

    I have 2 spreadsheets. One has names, phone numbers, and addresses. The second has names and another number(Let's call it ID Number). The problem is that the first one has over 14000 entries, while the 2nd one has around 600. All the names in the 2nd table are also in the first one, and so I want to add all the ID numbers to all the matching entries in the 1st table, based on name.

    I've been trying to do this with VLOOKUP, and I can't seem to do it, and feel like an idiot. Can anyone help me out?
    Last edited by Killericon; 06-03-2010 at 11:01 AM.

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

    Re: Combining Seperate Tables With Multiple Values

    Let's say your first table is on sheet1 with Name in the first column beginning in row 2.
    Your second table is on Sheet2 with Name in the first column beginning in row 2 and ID in Column B.

    Add a column on Sheet1 for id and in row 2 dragged down
    =VLOOKUP(A2,Sheet2!$A$2:$B$1000,2,FALSE)
    If your names are exact matches, that should 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

  3. #3
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Seperate Tables With Multiple Values

    Quote Originally Posted by ChemistB View Post
    Let's say your first table is on sheet1 with Name in the first column beginning in row 2.
    Your second table is on Sheet2 with Name in the first column beginning in row 2 and ID in Column B.

    Add a column on Sheet1 for id and in row 2 dragged down
    =VLOOKUP(A2,Sheet2!$A$2:$B$1000,2,FALSE)
    If your names are exact matches, that should work for you.
    The names in the second sheet have capitalized first letters, then non capitalized. The first sheet is in all-caqps, but there's got to be a way to quickly change the first sheet's names to not all-caps, right?

    Thanks for the help!

  4. #4
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    Check that, found a solution. Thanks for the help!

  5. #5
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Seperate Tables With Multiple Values

    Quote Originally Posted by ChemistB View Post
    Let's say your first table is on sheet1 with Name in the first column beginning in row 2.
    Your second table is on Sheet2 with Name in the first column beginning in row 2 and ID in Column B.

    Add a column on Sheet1 for id and in row 2 dragged down
    =VLOOKUP(A2,Sheet2!$A$2:$B$1000,2,FALSE)
    If your names are exact matches, that should work for you.
    Check that, for some reason it's not working.

    So, I have the two tables. I've got the names exactly the same(Column 1 is last names, Column 2 is First, though I'm gonna combine the two(on both sheets) to have column 1 be Last, First.

    When I try to do your function, it asks me to open another file. Shouldn't it find the second sheet within the open book?

  6. #6
    Registered User
    Join Date
    05-20-2010
    Location
    Fresno, CA
    MS-Off Ver
    2003, 2010
    Posts
    58

    Re: Combining Separate Tables With Multiple Values

    Are the names in one column or two? Is it the same on both sheets? Could you attach a sample workbook? You don't have to keep all 14,000 rows on the first sheet, and you should replace the phone numbers and addresses with dummy data. You could just use something like 555-555-5555 for the phone number and 123 Mockingbird Lane for the address and copy them down the entire list.
    Last edited by Ryan Murtagh; 05-27-2010 at 05:18 PM. Reason: requested sample workbook
    Thanks,
    Ryan



    A word to the wise is infuriating. - Hunter S Thompson

  7. #7
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    Quote Originally Posted by Ryan Murtagh View Post
    Are the names in one column or two? Is it the same on both sheets? Could you attach a sample workbook? You don't have to keep all 14,000 rows on the first sheet, and you should replace the phone numbers and addresses with dummy data. You could just use something like 555-555-5555 for the phone number and 123 Mockingbird Lane for the address and copy them down the entire list.
    Sure thing. Here it is. Instead of 14000 and 600, it's 4 and 2, but it gives you an idea of the problem.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    Can anyone give me a hand with this?

  9. #9
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    Desperation bump.

    Can anyone give me a hand with this? I'm ramming my head against a wall.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Combining Separate Tables With Multiple Values

    In E2 and copied down,

    =INDEX(Sheet1!C1:C1000, MATCH(Sheet2!A2 & Sheet2!B2, Sheet1!A1:A1000 & Sheet1!B1:B1000, 0))

    The formula MUST be confirmed with CTrl+Shift+Enter, not just Enter.
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    No Dice. It seems to work in the example sheet I uploaded, but not in my sheet. I'm going to upload the one I'm actually working with...I really appreciate the help.

    I also consolidated the last and first names, in case that makes things easier.

    Nevermind privacy, I had to delete most of the information just to get the thing small enough to upload.

    http://www.2shared.com/document/BCyu...s_Upload_.html
    Last edited by Killericon; 06-01-2010 at 01:53 PM. Reason: Deleted spurious quote

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

    Re: Combining Separate Tables With Multiple Values

    SHG's formula should work. I cannot assess the other site. Can you upload a zipped copy to this site? (Go Advanced>Manage Attachments).

  13. #13
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    Quote Originally Posted by ChemistB View Post
    SHG's formula should work. I cannot assess the other site. Can you upload a zipped copy to this site? (Go Advanced>Manage Attachments).
    Sure! Here you go. I also had to cut the list in half to get it small enough.
    Last edited by Glenn Kennedy; 12-14-2020 at 12:32 PM.

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

    Re: Combining Separate Tables With Multiple Values

    Okay, first, adjusting it for your workbook.......
    =INDEX('Sheet 1'!$B$2:$B$1000, MATCH(A2, 'Sheet 1'!$A$2:$A$1000, 0))
    Since you combined first and last names, you don't need to use CNTRL SHFT ENTER and it's simplified. Also, Sheet1 (and 2) became 'Sheet 1' because your workbook has spaces in there. This still end up giving #NA's because on Sheet 1, you have a double space between the last and first name. Just select column A, CNTRL H to bring up the Search and Replace and "Find What" type in double space, "Replace with" type in single space and replace all. Does that work for you now?

  15. #15
    Registered User
    Join Date
    05-27-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Combining Separate Tables With Multiple Values

    Quote Originally Posted by ChemistB View Post
    Okay, first, adjusting it for your workbook.......
    =INDEX('Sheet 1'!$B$2:$B$1000, MATCH(A2, 'Sheet 1'!$A$2:$A$1000, 0))
    Since you combined first and last names, you don't need to use CNTRL SHFT ENTER and it's simplified. Also, Sheet1 (and 2) became 'Sheet 1' because your workbook has spaces in there. This still end up giving #NA's because on Sheet 1, you have a double space between the last and first name. Just select column A, CNTRL H to bring up the Search and Replace and "Find What" type in double space, "Replace with" type in single space and replace all. Does that work for you now?
    I owe you a beer or something. Thanks!

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Combining Separate Tables With Multiple Values

    As per your request regarding respecting data confidentiality, I hav eremoved the attachment.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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