How to Merge Excel Tables by ID Using XLOOKUP

Merge by ID — Excel | analytics.bi
If merging tables in Excel feels like a task where something always goes wrong, you are not alone. Many people get stuck on VLOOKUP, get #N/A errors, or have to go ask a colleague for help again.

When working with Excel, you often need to merge two tables by a common ID column. For example, one table has a list of employees, and another – their salaries. The goal is to add the salary to each employee.

VLOOKUP is most often used for this, but it has quite a few limitations and often causes errors. Because of that, a simpler and more reliable solution is increasingly chosen – XLOOKUP.

If you want to compare these functions in more detail, we recommend also reading this article:XLOOKUP vs VLOOKUP: how they differ and which function to use.

Let’s look at the general logic.

We have two tables

The first table:

ID | Name | Department

The second table:

ID | Salary

The goal is to add a salary column to the first table by ID.

Dvi Excel lentelės jungiamos pagal bendrą ID stulpelį
The two tables are merged by a common ID column.

The table-merging logic

Merging tables happens in three steps:

  • a common ID column is chosen
  • the matching value is found in the other table
  • the desired column is returned

The XLOOKUP function makes this logic simple to implement.

Example:

=XLOOKUP(A2, G:G, I:I)

The formula:

  • looks for the ID
  • finds the match
  • returns the result

Unlike VLOOKUP, you do not need to:

  • count column numbers
  • sort the tables
  • worry about inserting columns

When XLOOKUP is especially useful

XLOOKUP is convenient to use when:

  • you merge two tables by ID
  • the data is updated frequently
  • the tables are large
  • you need a reliable result
  • VLOOKUP often returns errors

In such situations XLOOKUP lets you merge tables quickly and stably.

Common problems when merging tables

Even when using XLOOKUP, problems can arise:

  • different ID formats
  • spaces in the data
  • non-unique IDs
  • missing values
  • #N/A errors

That is why not only the formula matters, but also the correct preparation of the tables.

If you want to understand more deeply why tables do not merge, we recommend also reading these articles:XLOOKUP not working?andVLOOKUP not working?

Want a simpler way to merge Excel tables?

In the mini course we show how to use XLOOKUP in practice and without unnecessary confusion.

🎓 View the mini course

If the button doesn’t work, open the course here:open the course

Free cheat sheet

Power Query cheat sheet: automate your report

The key steps, the 5 common mistakes, and when automating is worth it.

  • PDF · 2 pages, practical
  • No spam — value only
Blank Form (#5) (#6)
No spam. Unsubscribe anytime.

Similar Posts