ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. How to Merge Two Tables in Excel With XLOOKUP or Power Query

How to Merge Two Tables in Excel With XLOOKUP or Power Query

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To merge two tables in Excel, match them on a shared column such as a customer ID. With formulas, add XLOOKUP to the first table, for example =XLOOKUP(B2,$E$2:$E$4,$F$2:$G$4,"Not found"), to bring columns across. With Power Query, load both tables and use Merge Queries with a Left Outer join. Power Query suits large tables you refresh often.

Key takeaways

  • Merging means joining two tables on a shared key column, such as an ID, so each row gains columns from the other table.
  • XLOOKUP can return several columns at once and shows your own text when a key has no match.
  • VLOOKUP with FALSE does the same job in older Excel, one column at a time.
  • Power Query's Merge Queries joins whole tables, offers join types like Left Outer and Inner, and refreshes in one click.
  • Most failed matches come from extra spaces or numbers stored as text in the key column.
On this page+
  1. What merging two tables means
  2. The example tables
  3. Merge two tables with XLOOKUP
  4. Bring back several columns at once
  5. Merge with VLOOKUP in older Excel
  6. Merge two tables with Power Query
  7. Formula or Power Query: which to use?
  8. Why do some rows not match?
  9. Practise it

To merge two tables in Excel, you match their rows on a column they share, such as a customer ID, and bring the other table's columns across. You can do it with a lookup formula like XLOOKUP, which updates instantly, or with Power Query's Merge Queries, which joins whole tables and refreshes in one click. This guide shows both on the same small example, plus VLOOKUP for older Excel and fixes for rows that don't match.

What merging two tables means#

Merging, also called joining, puts two tables side by side. A key column links them: a value that appears in both, like an order's customer ID and the ID in a customer list. Each row in the first table gains the matching columns from the second.

That's different from appending, which stacks two tables with the same columns on top of each other, such as January and February sales. If that's what you need, use Power Query's Append Queries or, in Microsoft 365, the VSTACK function.

The example tables#

An orders table in A1:C6 has a customer ID but no customer details. A customer table in E1:G4 has the details:

OrderCustomer IDAmount
1001C-102250
1002C-101400
1003C-104150
1004C-102320
1005C-103180
IDNameRegion
C-101AmaraNorth
C-102BenSouth
C-103ChenEast

Customer C-104 is missing from the customer table on purpose, so you can see what happens to a row with no match. The tables can be on different sheets; the guide to VLOOKUP between two sheets shows how the references look then.

Merge two tables with XLOOKUP#

XLOOKUP finds a value in one column and returns the matching value from another. In D2, next to the first order:

Excel formula
=XLOOKUP(B2,$E$2:$E$4,$F$2:$F$4,"Not found")

It looks for C-102 in the ID column and returns Ben. The fourth argument, "Not found", is shown instead of an #N/A error when a key is missing. Fill it down (Windows: Ctrl+D; Mac: ⌘D); the $ signs keep the customer table fixed as the formula moves. XLOOKUP needs Excel 2021 or Microsoft 365. The XLOOKUP function guide lists every argument, and the article on how to use XLOOKUP covers match modes and errors.

Bring back several columns at once#

XLOOKUP can return more than one column if the return range is wider. To get both Name and Region:

Excel formula
=XLOOKUP(B2,$E$2:$E$4,$F$2:$G$4,"Not found")

The result spills into D2:E2: Ben in D2 and South in E2. Fill it down and the merged table looks like this:

OrderCustomer IDAmountNameRegion
1001C-102250BenSouth
1002C-101400AmaraNorth
1003C-104150Not foundNot found
1004C-102320BenSouth
1005C-103180ChenEast

The cells to the right must be empty, or you get a #SPILL! error. For more on returning whole rows, see XLOOKUP with multiple columns.

Merge with VLOOKUP in older Excel#

VLOOKUP does the same job in every version of Excel, one column at a time. For Name, in D2:

Excel formula
=VLOOKUP(B2,$E$2:$G$4,2,FALSE)

The 2 means "return the second column of E:G", and FALSE asks for an exact match. For Region, change the 2 to 3. VLOOKUP shows #N/A for C-104, so wrap it to show your own text: =IFNA(VLOOKUP(B2,$E$2:$G$4,2,FALSE),"Not found"). The key must be the first column of the lookup range, because VLOOKUP only looks to the right. The VLOOKUP function guide explains each argument.

Merge two tables with Power Query#

Power Query joins whole tables without formulas. It is built into Excel 2016 and later on Windows, and into Microsoft 365 on Mac. Follow these steps:

  1. Click inside the orders data and choose Insert > Table. On the Table Design tab, name it Orders. Do the same for the customer data and name it Customers.
  2. With a cell in Orders selected, choose Data > From Table/Range. In the Power Query Editor, choose Home > Close & Load To, then Only Create Connection. Repeat for Customers.
  3. Choose Data > Get Data > Combine Queries > Merge.
  4. Pick Orders in the top box and Customers in the bottom box. Click the Customer ID column in the top preview and the ID column in the bottom one.
  5. Leave Join Kind as Left Outer (all rows from the first table, matching rows from the second) and click OK.
  6. A new column holds the matching customer rows. Click the expand button in its header, tick Name and Region, untick "Use original column name as prefix", and click OK.
  7. Choose Home > Close & Load. The merged table appears on a new sheet.

When the orders or customers change, choose Data > Refresh All and the merge runs again. Other join kinds change which rows you keep: Inner keeps only orders with a matching customer, so order 1003 disappears, and Left Anti keeps only the orders with no match, which is a quick way to find problems. New to Power Query? Start with Power Query for beginners.

Formula or Power Query: which to use?#

Both give the same merged table here. Pick by the job:

SituationBetter choice
A quick one-off merge of a few columnsXLOOKUP or VLOOKUP
Results must update the moment you typeXLOOKUP or VLOOKUP
Tens of thousands of rows, or many columnsPower Query
The same merge every week from new exportsPower Query
You need inner, anti or full outer joinsPower Query
A job test asks for a formulaXLOOKUP, or VLOOKUP if named

One key difference: if a customer ID appears twice in the customer table, XLOOKUP and VLOOKUP return only the first match. Power Query returns every match, so an order row can turn into two rows. Check the key column for duplicates before you merge.

Why do some rows not match?#

When a merge shows Not found or #N/A for a key you can see in both tables, the keys aren't exactly the same. Check these:

  • Extra spaces. "C-102 " with a trailing space doesn't match "C-102". Clean the column with TRIM.
  • Numbers stored as text. An ID of 1001 as a number doesn't match "1001" as text. Convert one side with VALUE, or with B2&"" to turn numbers into text.
  • Different formats. "C102" and "C-102" are different keys. Standardise them with SUBSTITUTE first.

To see which keys are missing from either table before you merge, compare the two lists.

Practise it#

Try the exercise on this page: one XLOOKUP brings a region into the orders table. Then practise XLOOKUP in a live spreadsheet and work through the VLOOKUP practice lesson. Both check your formulas as you type, so you'll be ready for the lookup questions in a job test.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Bring each order's region across from the customer table. Click D2 and use XLOOKUP to find the customer ID in B2 in E2:E4, return the region from G2:G4, and show "Not found" if there's no match. Press Enter.

fx
ABCDEFGH
1
Order
Customer ID
Amount
Region
ID
Name
Region
2
1001
C-102
250
C-101
Amara
North
3
1002
C-101
400
C-102
Ben
South
4
1003
C-104
150
C-103
Chen
East
5
1004
C-102
320
6
7
8

Tip: XLOOKUP needs what to find (B2), where to look (E2:E4), what to return (G2:G4), and then the text for no match.

Practise this in a lesson

LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.LessonVLOOKUP practicePractice exact and approximate VLOOKUPs on a real order sheet: item names, prices, discount tiers and a mistyped code.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.

Frequently asked questions

How do I merge two tables with a common column in Excel?

+

Add a lookup formula to the first table that finds each key in the second table and returns the columns you need, such as =XLOOKUP(B2,$E$2:$E$4,$F$2:$G$4,"Not found"). For large or repeated jobs, use Power Query's Merge Queries instead.

Can I merge tables in Excel without formulas?

+

Yes. Power Query can do it: load both tables, choose Data > Get Data > Combine Queries > Merge, pick the matching columns and expand the columns you want. The result is a new table you can refresh.

What happens to rows that have no match?

+

XLOOKUP returns its if_not_found text, such as Not found, and VLOOKUP returns #N/A. In Power Query, a Left Outer join keeps the row with empty values, while an Inner join drops it.

How is merging different from appending tables?

+

Merging joins tables side by side on a key, adding columns. Appending stacks tables with the same columns on top of each other, adding rows. Use Power Query Append or VSTACK in Microsoft 365 to append.

Sources

  • XLOOKUP function - Microsoft Support
  • VLOOKUP function - Microsoft Support
  • Overview of Excel tables - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What merging two tables means
  2. The example tables
  3. Merge two tables with XLOOKUP
  4. Bring back several columns at once
  5. Merge with VLOOKUP in older Excel
  6. Merge two tables with Power Query
  7. Formula or Power Query: which to use?
  8. Why do some rows not match?
  9. Practise it

Keep reading

Lookups· 7 min read

XLOOKUP in Excel: Everything a Beginner Needs

XLOOKUP finds a value in one range and returns the matching item from another: =XLOOKUP(G2,B2:B9,A2:A9). It defaults to an exact match, can return a column on either side, and has a built-in if_not_found message instead of #N/A. It needs Excel 2021, Excel 2024 or Microsoft 365; it isn't in Excel 2019 or earlier.

Lookups· 6 min read

VLOOKUP Between Two Sheets, Step by Step

To VLOOKUP between two sheets, add the sheet name and an exclamation mark before the table range: =VLOOKUP(B2,Products!$A$2:$C$6,3,FALSE). The easiest way is to start typing the formula, click the other sheet's tab, select the table, and press Enter. If the sheet name has spaces, Excel wraps it in single quotes, like 'Price List'!$A$2:$C$6.

Productivity· 6 min read

Power Query in Excel for Beginners: What It Does

Power Query is Excel's built-in tool for importing and cleaning data. You load data from a table, file or folder, fix it with commands such as Trim, Split Column and Remove Duplicates, and Excel records each step. Click Refresh and every step runs again on new data. Find it on the Data tab, under Get & Transform Data.

More on lookups

  • Find the Most Frequent Text Value in Excel
  • Return the Name Next to the Highest Value in Excel
  • OFFSET Function in Excel: Move and Resize a Range
  • Return the Column Header for a Value in Excel
  • Tax Bracket and Tier Lookups in Excel
  • Two-Way Lookup in Excel (Row and Column)
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free