Computer >> Computer tutorials >  >> Software >> Office

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Consider the List of Customer Orders containing the “Product ID”, “Customer”, and “Date”.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Mind this List of Products and Sales with “Product ID”, “Item”, and “Sales” in USD.

Perform an outer join based on the common “Product ID”:

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Method 1 – Using the IFERROR and the VLOOKUP Functions

Steps:

  • Go to B4 >> press CTRL + T to create and insert a Table.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Name the Table “Order_Tbl”.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Create a second Table and name it “Product_Tbl”.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Go to C5 and enter the formula below.

=IFERROR(VLOOKUP([@[Product ID]],Order_Tbl,2,FALSE),"")

Product ID refers to the column header, whereas Order_Tbl is the Table range.

Formula Breakdown:

  • VLOOKUP([@[Product ID]],Order_Tbl,2,FALSE) → looks for a value in the left-most column of a table, and returns a value in the same row from a specified column. Here, [@[Product ID]] ( lookup_value argument) is mapped in the Order_Tbl (table_array argument) array in the “Order” worksheet.  2 (col_index_num argument) represents the column number of the lookup value. FALSE (range_lookup argument) refers to the Exact match of the lookup value.
    • Output → “Sam”
  • IFERROR(VLOOKUP([@[Product ID]],Order_Tbl,2,FALSE),””) becomes
    • IFERROR(“Sam”,“”) → returns value_if_error if the expression has an error. Otherwise, the value of the expression. Here, “Sam” is the value argument, and “”(Blank) is the value_if_error argument. The function returns “Sam”.
    • Output → “Sam”

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Go to the D5 and use the expression below.

=IFERROR(VLOOKUP([@[Product ID]],Order_Tbl,3,FALSE),"")

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Enter the equation below in E5.

=IFERROR(VLOOKUP([@[Product ID]],Product_Tbl,2,FALSE),"")

The Product_Tbl represents the Table range.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Select F5 and enter the expression in the Formula Bar.

=IFERROR(VLOOKUP([@[Product ID]],Product_Tbl,3,FALSE),"")

This is the output.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Method 2 – Utilizing the Power Query Editor

Steps:

  • Select B4 in the “Order” worksheet >>go to the Data tab >> select From Table/Range.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Click Close & Load  >> choose Close & Load To.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Check Only Create Connection >> click OK.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Repeat the procedure for the Table in the “Order” worksheet.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Go to Get Data >> select Combine Queries >> choose Merge.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Follow the steps shown in the GIF below.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Click Close & Load To.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • In the Import Data window, check Table and New Worksheet  >> click OK.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

This is the final output.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

How to Execute a Full Outer Join in Excel

Perform a full outer join combining all rows in the two datasets/tables into one.

Steps:

  • Go to the “Best Sellers” worksheet >> create a Table and name it “Best_Sellers_Tbl”.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Repeat the previous step in the “Quantity” worksheet to create the “Quantity_Tbl”.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Load and Establish a Connection between Tables by following the steps described above.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Go to Get Data >> choose Merge in Combine Queries.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Follow the steps shown in the GIF below.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Load the data into a New Worksheet as a Table.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

This is the output.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Read More: How to Perform Left Join in Excel

How to perform an Inner Outer Join in Excel

Steps:

  • Load the Tables into the PowerQuery editor >> Merge the two queries as shown below.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

  • Close & Load the transformed data into a new worksheet.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Read More: How to Inner Join in Excel

Practice Section

Practice here.

Master Excel Outer Joins: 2 Proven Methods for Seamless Data Merging

Download Practice Workbook

Related Articles

  • How to Combine Two Tables Using Power Query in Excel
  • How to Perform Left Outer Join in Excel
  • How to Create Cross Join in Excel

<< Go Back to Power Query Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!