How to Find Matching Values in Two Worksheets in Excel

Method 1 – Using the EXACT Function in Excel to Find Matching Values in Two Worksheets

We have two different datasets in two worksheets. The dataset contains the columns named “Unique ID”, “Name”, and “Salary” of some sales reps. We’ll find matching values that are present in both worksheets. The “Sales-Jan” worksheet is shown below.

Here’s the next dataset. We put a “Matching ID” column to display the results.

Steps:

  • In cell F5, apply the following function.
=EXACT(text1,text2)
  • Insert the values so it looks like the following:

=EXACT($B$5:$B$16,'Sales-Jan'!$B$5:$B$16)

Text1 is $B$5:$B$16 as we want to find the matching IDs between two worksheets. Text2 is ‘Sales-Jan’!$B$5:$B$16 which is the Unique ID column in Sales-Jan.

Use EXACT Function to Find Matching Values in Two Worksheets

  • Press Enter to get the result.

excel find matching values in two worksheets

  • The EXACT function is returning FALSE when the value is not matched and TRUE for those values which are matched.

Read More: How to Find Duplicate Rows in Excel


Method 2 – Combining MATCH with the ISNUMBER Function to Get Matching Values

Steps:

  • In cell F5, apply the following formula:

=ISNUMBER(MATCH(B5,'Sales-Jan'!$B$5:$B$16,0))

Lookup_values is B5, Lookup_array is ‘Sales-Jan’!$B$5:$B$16 (You can click on the Sales-Jan worksheet to go there and select the array). [match_type]is EXACT (0).

Combine MATCH with ISNUMBER Function to Get Matching Values in Two Worksheets

  • Hit Enter.

Combine MATCH with ISNUMBER Function to Get Matching Values in Two Worksheets

  • The formula will give you “TRUE” if the values are matched.
  • Apply the same formula via AutoFill for the rest of the cells to get the final result.

Combine MATCH with ISNUMBER Function to Get Matching Values in Two Worksheets

Read More: How to Find Repeated Cells in Excel


Method 3 – Inserting the VLOOKUP Function to Find Matching Values in Two Worksheets

Steps:

  • Use the following function in F5:

=VLOOKUP(B5,'Sales-Jan'!$B$5:$C$16,2,FALSE)

  • Col_index_num is 2. We want to get the matching names with the matching IDs
  • [range_lookup]value is FALSE (Exact)

Insert VLOOKUP Function to Find Matching Values in Two Worksheets

  • Press Enter to get the result.

Insert VLOOKUP Function to Find Matching Values in Two Worksheets

  • Apply the same function to the rest of the cells to get the final result. When the VLOOKUP doesn’t find the matching values, it will return the #N/A error.

Read More: How to Find Repeated Numbers in Excel


Method 4 – Merging IF with ISNA to Obtain Matches from Two Worksheets

Steps:

  • Use the following formula in F5:

=IF(ISNA(VLOOKUP(B5,'Sales-Jan'!$B$5:$C$16,2,FALSE)),"NO","YES")

  • If the values are matched, the formula will return YES. Otherwise, it will return NO.

Merge IF with ISNA Formula to Obtain Matches from Two Worksheets in Excel

  • Apply the function by pressing Enter.

  • Apply the same formula to the rest of the cells via AutoFill to get the final result.

Merge IF with ISNA Formula to Obtain Matches from Two Worksheets in Excel

Read More: How to Filter Duplicates in Excel


Method 5 – Using Conditional Formatting to Find Matching Values in Two Worksheets

Steps:

  • Choose cells (B5:C16) and select New Rule from the Conditional Formatting section.

Use Conditional Formatting to Find Matching Values in Two Worksheets

  • In the New Formatting Rule window, choose Use a formula to determine which cells to format.
  • Insert the following formula into the box.
=COUNTIF('Sales-Jan'!$B$5:$C$16,B5)
  • Click Format.

Use Conditional Formatting to Find Matching Values in Two Worksheets

  • Choose a color from Fill and hit OK.

  • Click OK to finish.

  • This highlights all matching values.

Use Conditional Formatting to Find Matching Values in Two Worksheets

Read More: How to Compare Rows for Duplicates in Excel


Things to Remember

  • The EXACT function is case-sensitive. It won’t see Alexander and alexander as being a match.
  • The VLOOKUP function always searches for lookup values from the leftmost top column to the right. This function never searches for the data on the left.
  • When you select your Table_Array, you have to use absolute cell references ($) to block it from being modified via AutoFill.

Download the Practice Workbook


Similar Articles for You to Explore


<< Go Back to Find Duplicates in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Asikul Himel
Asikul Himel

Asikul Islam Himel, holding a BSc in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology, has contributed over two years to the ExcelDemy project. Starting as an Excel & VBA Content Developer, now he manages projects at You Have Got This Math Project. He wrote 60+ articles for ExcelDemy, reviewed 500+, and focused on quality maintenance. Currently, his responsibilities include project management and team leadership. Himel's interests encompass data analysis, leadership, WordPress applications, and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo