How to merge two tables in excel
Tutor 5 (68 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
How to Merge Two Tables in Excel
Merging two tables in Excel is the process of combining data from separate tables into one unified table. The method you use depends on whether the tables share a common column (like IDs or names) or if you want to append them one below the other.
1. Using VLOOKUP to Merge Tables with a Common Column
A common approach is to use VLOOKUP when both tables share a key column.
Steps:
-
Ensure both tables have a common column. For example, Table 1 has
Employee IDandName, and Table 2 hasEmployee IDandDepartment. -
Select the cell where you want to display merged data (e.g., in Table 1, next to
Name). -
Enter the formula:
=VLOOKUP(A2, Table2!$A$2:$B$100, 2, FALSE)
-
A2is the key in Table 1 (Employee ID). -
Table2!$A$2:$B$100is the range of Table 2. -
2indicates the column number in Table 2 to retrieve the (Department). -
FALSEensures an exact match.
-
Drag the formula down for all rows. Table 1 now includes the department information from Table 2.
2. Using XLOOKUP (Recommended in Latest Excel Versions)
XLOOKUP is more flexible and avoids column index issues.
Steps:
-
Select the cell in Table 1 where the merged data should appear.
-
Enter the formula:
=XLOOKUP(A2, Table2!A:A, Table2!B:B, "Not Found")
-
A2is the lookup value from Table 1. -
Table2!A:Ais the lookup array (key column in Table 2). -
Table2!B:Bis the return array (column to retrieve). -
"Not Found"is displayed if no match exists.
-
Press Enter and drag down for all rows.
3. Using Power Query to Merge Tables
Power Query is ideal for larger datasets and advanced merging.
Steps:
-
Go to Data → Get & Transform Data → Get Data → From Table/Range for Table 1.
-
Repeat the process for Table 2.
-
In the Power Query editor, click Home → Merge Queries.
-
Select the matching column in both tables.
-
Choose the Join Kind:
-
Left Join: Keeps all rows from the first table and matches from the second.
-
Inner Join: Keeps only rows present in both tables.
-
Right Join: Keeps all rows from the second table and matches from the first.
-
Full Outer Join: Keeps all rows from both tables.
-
-
Click OK, expand the merged columns, and load the data back to Excel.
4. Appending Tables (One Below the Other)
If both tables have identical columns and you want to stack them:
-
Copy the second table.
-
Paste it below the first table in the same columns.
-
Excel will automatically extend the table if both are formatted as tables. Otherwise, select both ranges and use Insert → Table to combine them.
5. Tips for Merging Tables
-
Ensure column names match when using
VLOOKUPorXLOOKUP. -
Avoid duplicate rows by checking key columns.
-
Use Remove Duplicates under Data → Data Tools after merging.
-
Format both tables as tables (
Ctrl + T) for dynamic ranges.
This approach works on both Windows and Mac versions of Excel. On Mac, the formula structure is identical, but menu labels may slightly differ (e.g., Data → Get Data → From Table/Range might appear as Data → Get & Transform → From Table).
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to merge excel files into one file
Answers · 1
How to merge excel files into one
Answers · 1
How to mail merge from excel to email
Answers · 1
How to mail merge from excel to pdf
Answers · 1