How to perform an Inner Join in Excel – 2 Methods

Consider two tables with examination mark of math and physics.

Dataset Overview

Note

Method 1 – Applying the VLOOKUP Function to perform an Inner Join in Excel

Use the VLOOKUP function.

Steps:

  • In a new sheet, store all IDs in B5:B14.
  • Select C5 and enter the following formula:

=VLOOKUP(B5,Dataset!$B$5:$C$14,2,FALSE)

  • Press Enter.

Using VLOOKUP function to get the math marks to inner join

  • Select D5 and use the following formula:

=VLOOKUP(B5,Dataset!$E$5:$F$14,2,FALSE)

  • Press Enter.

Use of VLOOKUP function to get the physics marks to inner join in Excel

  • Select C5:D5 and drag down the Fill Handle  to copy the formula to the rest of the cells.

This is the output.

Applying VLOOKUP Function to Inner Join in Excel

 


Method 2 – Using the Power Query Feature to perform an Inner Join in Excel

 Steps:

  • Select B4:C14.
  • In the Data tab, click From Table/Range in Get & Transform.

Opening From Table/Range option to inner join

  • In the Create Table dialog box, check My table has headers.
  • Click OK.

  • The Power Query Editor will be displayed.
  • In the Home tab, click Close & Load and choose Close & Load To.

Create connection in Table

  • In Import Data, choose  Only Create Connection.
  • Click OK.

Choosing suitable option for the connection

  • Follow the same procedure for the second table to create a connection.

  • In the Data tab, click Get Data and choose Combine Queries > Merge.

launching Merge dialog box to inner join to table in Excel

  • In the Merge dialog box, click the drop-down arrow and select Table1.
  • Click the ID column.

  • Follow the same procedure in the lower field.
  • In Join Kind, select Inner (only matching rows).
  • Click OK.

  • In the Power Query Editor table, click the expand icon in the heading of Table2.

Click on Expand icon to inner join in Excel

  • Uncheck ID and click OK.

  • In the Home tab, click Close & Load.

  • A new sheet will open, showing the joined table.

Using Power Query Feature to Inner Join in Excel

 

Note

To outer join in Excel, choose Full Outer (all rows from both) in Join Kind.

Read More: How to Combine Two Tables Using Power Query in Excel


How to perform Left Join in Excel

Use the VLOOKUP function. The dataset is in B5:G14.

 

Steps:

  • In a new sheet, store the first table in B5:C14.
  • Select D5 and use the following formula:

=VLOOKUP('Left Join'!B5,Left!$E$5:$G$14,{2,3},FALSE)

  • Press Enter.

Utilizing VLOOKUP function to left inner in Excel

  • Drag down the Fill Handle to see the result in the rest of the cells.

Using AutoFill Handle icon to copy formula

  • This is the output.

Perform Left Join in Excel

 


Download Practice Workbook

Download the practice workbook.


Related Articles


<< Go Back to Power Query Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Soumik Dutta
Soumik Dutta

Soumik Dutta, having earned a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, plays a key role as an Excel & VBA Content Developer at ExcelDemy. Driven by a profound passion for research and innovation, he actively immerses himself in Excel. In his role, Soumik not only skillfully addresses complex challenges but also demonstrates enthusiasm and expertise in gracefully navigating tough situations, underscoring his unwavering commitment to consistently deliver exceptional, high-quality content that... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo