Combining data from two tables in Excel into one new table

%3CLINGO-SUB%20id%3D%22lingo-sub-1943928%22%20slang%3D%22en-US%22%3ECombining%20data%20from%20two%20tables%20in%20Excel%20into%20one%20new%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1943928%22%20slang%3D%22en-US%22%3E%3CP%3EHave%20been%20struggling%20for%20hours%20with%20a%20task%20in%20Excel%20that%20should%20be%20very%20simple.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20two%20tables%20in%20Excel%20in%20two%20sheets.%20They%20are%20names%20tblEx%20and%20tblSales%2C%20and%20each%20have%20unique%20records.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20combine%20these%20tables%20into%20a%20third%20table%2C%20which%20contains%20all%20the%20records%20from%20the%20first%20two%20tables.%20In%20the%20third%20sheet%20%22combined%20table%22%20is%20the%20table%20I%20want%20to%20get.%20I%20want%20to%20do%20this%20without%20copy%20and%20paste%2C%20as%20I%20need%20to%20do%20it%20for%20a%20large%20amount%20of%20data.%20(The%20attached%20workbook%20is%20just%20an%20example%20with%20a%20small%20amount%20of%20dummy%20data.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20knows%20how%20to%20do%20this%3F%20Can't%20believe%20that%20there%20is%20no%20function%20for%20this%20in%20Excel%2C%20but%20I%20have%20not%20been%20able%20to%20find%20any.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1943928%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1948019%22%20slang%3D%22en-US%22%3ERe%3A%20Combining%20data%20from%20two%20tables%20in%20Excel%20into%20one%20new%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1948019%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F156456%22%20target%3D%22_blank%22%3E%40Faraz%20Shaikh%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20for%20replying.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20your%20Solution%2002.%3C%2FP%3E%3CP%3EBut%20the%20only%20options%20I%20have%20for%20getting%20data%20from%20other%20source%20is%20From%20HTML%2C%20From%20Text%2C%20New%20Database%20Query%20%5BSQL%20Server%20ODBC%2C%20From%20Database%5D.%20there%20is%20no%20option%20for%20Blank%20Query.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20should%20probably%20have%20mentioned%20that%20I%20work%20in%20Excel%20365%20for%20Mac.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Have been struggling for hours with a task in Excel that should be very simple.

 

I have two tables in Excel in two sheets. They are names tblEx and tblSales, and each have unique records.

 

I want to combine these tables into a third table, which contains all the records from the first two tables. In the third sheet "combined table" is the table I want to get. I want to do this without copy and paste, as I need to do it for a large amount of data. (The attached workbook is just an example with a small amount of dummy data.)

 

Anyone knows how to do this? Can't believe that there is no function for this in Excel, but I have not been able to find any.

 

 

4 Replies

Hi @PeterW1 

 

There are different ways to handle it, I will be sharing you two solution & see what suites best for you

 

Solution 01

You can use this VBA code to combine all the data into your workbook.

Combine Active Workbook All Sheets into One Master Sheet with VBA | Excel Exciting

 

Note: looking the structure of your data note that code will break as the column A is empty. Start from the from A1

 

Solution 02 - [Excel 2010 & Above] 

This dynamic solution 

1. Convert your data into Excel Table (ctrl + t)

2. Give you table name 

3. Go to Data > GET Data > From Other Source > Blank Query

4. Power Query Editor

5. Incase if your formula bar is not enabling then click on VIEW > Layout > check the formula bar

6. In the formula bar enter "= Excel.CurrentWorkbook()" 

Note that this case sensitive

7. Select the table you like to combine

8. click on content expand table 

 

You will have all your records at one place. this is recommended solution

 

Note: you make your table header same before combining the records for both the solutions

 

Attached is the sample file.

 

Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert

If you find the above solution resolved your query don't forget mark as Official/Best Answer & like it to help the other members find it more.

Hi @Faraz Shaikh 

 

Thank you very much for replying.

 

I tried your Solution 02.

But the only options I have for getting data from other source is From HTML, From Text, New Database Query [SQL Server ODBC, From Database]. there is no option for Blank Query.

 

I should probably have mentioned that I work in Excel 365 for Mac.

 

Peter

@PeterW1 

Yes, Power Query on Mac is quite limited. 

@PeterW1 

 

Then you need go with the solution number 01, as rightly said by @Sergei Baklan currently Power Query for mac is limited. 

 

Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert

If you find the above solution resolved your query don't forget mark as Official/Best Answer & like it to help the other members find it more.