How to Match Data in Excel from 2 Worksheets (6 Methods)

Method 1 – Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

There are two sample workbooks named Book 1 and Book 2. Both workbooks contain different datasets starting in the same cell in Column B.

We can display these workbooks side-by-side and compare data visually for matches.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

 Steps:

  • Go to the first workbook Book 1.
  • Under the View tab, select the View Side by Side command from the Window drop-down.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

 

  • Select Synchronous Scrolling under the View Side by Side option.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

  • Click on the Arrange All option. A dialog box will appear.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

  • Choose the Vertical radio button from the options and press OK.

 

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

The two workbooks are now displayed side-by-side for comparison. This method is helpful to compare a small amount of data visually and find matches side-by-side from two workbooks.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks

As we’ve enabled Synchronous Scrolling, so if we scroll down in a workbook the other workbook will follow.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Different Workbooks


Method 2 – Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in separate Workbook

In this example there are two worksheets named Sheet1 and Sheet2 within a single Excel workbook.

Steps:

  • Go to the View ribbon.
  • From the Window dropdown, select New Window.

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Similar Workbook

 

  • The sheets are now displayed as two different workbooks as shown in the following picture.
  • Repeat the steps in the first method to compare data for Sheet1 from the first workbook and Sheet2 from the second workbook and find matches visually.

 

Compare and Match Data from 2 Worksheets by Viewing Side-by-Side in Similar Workbook


Method 3 – Match Data Side-by-Side from 2 Worksheets in Same Workbook and Return Outputs in Excel

The IF function will return the message Yes for the matched data and No for the non-matches.

Match Data Side-by-Side from 2 Worksheets in Same Workbook and Return Outputs in Excel

 

Match Data Side-by-Side from 2 Worksheets in Same Workbook and Return Outputs in Excel

Steps:

  • In cell C5 in Sheet1, enter the following formula:
=IF(B5=Sheet2!B5,"Yes","no")

Match Data Side-by-Side from 2 Worksheets in Same Workbook and Return Outputs in Excel

  • Press Enter and use Fill Handle to autofill the rest of the cells in Column C under the Match header.

Match Data Side-by-Side from 2 Worksheets in Same Workbook and Return Outputs in Excel


Method 4 – Match Data Side-by-Side from 2 Worksheets in Excel with Conditional Formatting

Steps:

  • Under the Home tab, select the option New Rule from the Conditional Formatting dropdown.
  • A dialog box named New Formatting Rule will appear.

Match Data Side-by-Side from 2 Worksheets in Excel by Highlighting Rows

  • Select the option Use a formula to determine which cells to format.
  • In the Rule Description box, enter the following formula:
=B5=Sheet2!B5
  • Press Format.

Match Data Side-by-Side from 2 Worksheets in Excel by Highlighting Rows

  • In the Format Cells window, select the Fill tab.
  • Select a color that will highlight the matches from two worksheets.
  • Press OK.

Match Data Side-by-Side from 2 Worksheets in Excel by Highlighting Rows

  • The New Formatting Rule dialog box will display a preview of the highlighted cell with text at the bottom.
  • Press OK.

Match Data Side-by-Side from 2 Worksheets in Excel by Highlighting Rows

In Sheet1, the matches are highlighted with the specified color.

Match Data Side-by-Side from 2 Worksheets in Excel by Highlighting Rows


Method 5 – Use VLOOKUP to Match Data from 2 Worksheets and Return Values in Excel

 

The first sheet contains a table with ID and Name and Address headers.

Use VLOOKUP to Match Data from 2 Worksheets and Return Values in Excel

The second worksheet contains the complete dataset.

VLOOKUP can be used to find matches in the second worksheet (Sheet2), extract addresses for the corresponding matches, and display them in the first worksheet (Sheet1).

Use VLOOKUP to Match Data from 2 Worksheets and Return Values in Excel

As the VLOOKUP function will return a #N/A error if a match is not found, we’ll combine the VLOOKUP function with the IFERROR function.

This will return a customized message Not Found if the VLOOKUP function does not find a match in Sheet2.

Steps:

  • Enter the below formula in cell C5 of Sheet1:
=IFERROR(VLOOKUP(B5,Sheet2!B5:C14,2,FALSE),"Not Found")

Use VLOOKUP to Match Data from 2 Worksheets and Return Values in Excel

  • Fill the entire column using the fill handle to return the following outputs under the Address header in Sheet1.

Use VLOOKUP to Match Data from 2 Worksheets and Return Values in Excel


Method 6 – Apply INDEX-MATCH Formula to Match Data and Return Values after Comparing 2 Worksheets

The INDEX function returns a value or reference from a cell in a given range, and the MATCH function returns the relative position of an item in an array that matches a specified value in a specified order.

Since the INDEX-MATCH formula will return an error if a match is not found, we’ll again use the IFERROR function to customize a return message for the non-matches.

Steps:

  • Enter the below formula in cell C5:
=IFERROR(INDEX(Sheet2!B5:C14,MATCH(Sheet1!B5,Sheet2!B5:B14,0),2),"Not Found")

Apply INDEX-MATCH Formula to Match Data and Return Values after Comparing 2 Worksheets

  • Press Enter and autofill the rest of the cells in Column C.

Apply INDEX-MATCH Formula to Match Data and Return Values after Comparing 2 Worksheets


Download Practice Workbook

 

 


<< Go Back to | Excel Match | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Nehad Ulfat
Nehad Ulfat

NEHAD ULFAT is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including ABACUS, AutoCAD, Rhinoceros, Maxsurf, and Hydromax. He got his B.Sc in Naval Architecture & Marine Engineering from BUET but switched gears, working as a content developer.  In this role, he creates techy content all about Excel... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo