+ Reply to Thread
Results 1 to 8 of 8

Merge two tables in a new one

  1. #1
    Registered User
    Join Date
    04-05-2011
    Location
    My place
    MS-Off Ver
    Excel 2010
    Posts
    3

    Merge two tables in a new one

    Hi folks,

    can anyone help me in merging two tables into one without using add in or other external software?

    Example: I have this two tables:

    T1 (my master table)
    Name Product Qty
    A Z 1
    B Y 2
    C X 3
    D W 4

    T2
    Name Web
    A www.a.com
    B www.b.com
    C www.c.com
    D www.d.com

    I'd like a new table with merge data from two two above:

    Name Product Qty Web
    A Z 1 www.a.com
    B Y 2 www.b.com
    C X 3 www.c.com
    D W 4 www.d.com

    Hope I was not confusing.

    Thanks for your support

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: Merge two tables in a new one

    Is this a one-off process? If so, I'd copy the first table and add an extra column with a VLOOKUP formula that looks something like this:
    Please Login or Register  to view this content.
    ...where A is the Name column of the new table and E2:F5 is the web address table.

  3. #3
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: Merge two tables in a new one

    Oh, meant to add before, if you then want the formula result to be hard-written into the cells, just click on the column, Copy, then Paste Special, Values.

  4. #4
    Registered User
    Join Date
    04-05-2011
    Location
    My place
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Merge two tables in a new one

    Quote Originally Posted by Kafrin View Post
    Is this a one-off process? If so, I'd copy the first table and add an extra column with a VLOOKUP formula that looks something like this:
    Please Login or Register  to view this content.
    ...where A is the Name column of the new table and E2:F5 is the web address table.
    Hi Kafrin thanks for the answer. I tried it but didn't work. I made the example very simple, but the fact is that the two tables are quite different, In fact there are different names, since the master table was implemented, while the other one contain less names.
    ].....Sometimes.....

  5. #5
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: Merge two tables in a new one

    Well is there any column that matches up in both tables? Or at least almost matches and is different in some consistant way? If not, you'll have problems anyway and it will probably require you to do at least some work manually (e.g. add a matching column to one table).

  6. #6
    Registered User
    Join Date
    04-05-2011
    Location
    My place
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Merge two tables in a new one

    Quote Originally Posted by Kafrin View Post
    Well is there any column that matches up in both tables? Or at least almost matches and is different in some consistant way? If not, you'll have problems anyway and it will probably require you to do at least some work manually (e.g. add a matching column to one table).
    Hi Kafrin

    In both tables I have the Coloumn "Name". Names in there are written in the same way in both tables.
    In table 1 "Name" is coloumn "B"
    In table 2 "Name" is coloumn "C"

    I would like Excel to add some info such as website, email address etc that are in Table 2 to Table 1.

  7. #7
    Registered User
    Join Date
    11-18-2010
    Location
    Johannesburg South Africa
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Merge two tables in a new one

    Seems that Vlookup is stil the answer, or a bit of simle VBA.
    Attach your samle sheet and we could solve your problem in no time.

    Regards
    Dan

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

    Re: Merge two tables in a new one

    VLOOKUP() normally can only bring back values to the RIGHT of the Name columns, possibly not ideal. I use INDEX/MATCH for this process so I can target column to MATCH and column to get values from (INDEX) specifically.

    For simplicity. let's assume:

    T1 is on Sheet1
    T2 is on Sheet2

    1) In the next empty column on T1 enter a title for the new column in row1

    2) In Row2, enter this formula, adjust the MATCH and INDEX ranges to the correct columns from Sheet2:

    =INDEX(Sheet2!D:D, MATCH(B2, Sheet2!$C:$C, 0))

    3) Copy that formula down the Sheet1 table

    4) Copy the new values, then Edit > Paste Special > Values
    _________________
    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!)

+ 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