How to find duplicates in two sheets
Tutor 5 (87 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To find duplicates in two sheets in Excel, use formulas, Conditional Formatting, or Power Query to compare values across worksheets and identify matches based on exact or defined criteria.
Method 1: Using a Formula with COUNTIF
What does this method do?
This method checks whether a value in one sheet appears in another sheet and returns a clear duplicate indicator.
When is this method appropriate?
This method is appropriate when comparing a single column of values such as IDs, names, or transaction numbers.
Steps
Open both worksheets in the same workbook.
Go to the first sheet that contains the data to check.
Insert a new helper column next to the data.
Enter the following formula in the helper column.
Fill the formula down for all rows.
Formula
=COUNTIF(Sheet2!A:A, Sheet1!A1)
How to interpret the result
A result greater than 0 means the value exists in both sheets.
A result equal to 0 means the value exists only in the current sheet.
Windows and Mac differences
No difference exists between Windows and Mac for this method.
Method 2: Returning a Clear Duplicate Label
What does this method do?
This method converts the numeric result into a readable label.
Steps
Insert a helper column.
Enter the formula below.
Fill the formula down.
Formula
=IF(COUNTIF(Sheet2!A:A, Sheet1!A1)>0, "Duplicate", "Unique")
Result
Each row displays either “Duplicate” or “Unique,” making review and filtering straightforward.
This method visually highlights duplicates without modifying the dataset.
Steps
Select the range in the first sheet.
Open Conditional Formatting.
Choose New Rule.
Select “Use a formula to determine which cells to format.”
Enter the formula below.
Choose a format.
Apply the rule.
Formula
=COUNTIF(Sheet2!A:A, A1)>0
Outcome
Matching values in both sheets appear highlighted immediately.
Windows and Mac differences
Menu labels differ slightly.
The rule logic and formula syntax remain identical.
Method 4: Finding Duplicates Across Multiple Columns
What does this method do?
This method compares rows based on combined column values, such as first name and last name.
Steps
Insert a helper column.
Combine columns logically using concatenation.
Apply the formula below.
Fill the formula down.
Formula
=COUNTIFS(Sheet2!A:A, Sheet1!A1, Sheet2!B:B, Sheet1!B1)
Interpretation
A value greater than 0 confirms a duplicate row across both sheets.
Method 5: Using Power Query for Large Data Sets
What does this method do?
Power Query compares sheets efficiently and scales well for large volumes of data.
Steps
Convert both data ranges into tables.
Load each table into Power Query.
Merge the queries using a matching column.
Choose an inner join.
Load the result back into Excel.
Advantages
This method handles tens of thousands of rows.
This method avoids manual formulas.
This method maintains data integrity.
Windows and Mac differences
Power Query features are fully available on Windows.
Mac supports Power Query with a reduced interface but identical merge logic.
Method 6: Removing Duplicates After Identification
What does this method do?
This method removes duplicate values after confirmation.
Steps
Select the data range.
Open the Remove Duplicates tool.
Choose the comparison columns.
Confirm the action.
Outcome
Excel retains the first occurrence and removes subsequent matches.
Accuracy and Data Integrity Considerations
Case sensitivity
COUNTIF is not case-sensitive.
Exact case matching requires advanced functions.
Leading and trailing spaces
Hidden spaces affect results.
Use TRIM before comparison when data quality varies.
Data type consistency
Text and numbers must match formats.
Mixed formats reduce match accuracy.
Performance Data
Formula-based comparisons perform efficiently under 10,000 rows.
Power Query maintains stable performance beyond 100,000 rows.
Conditional Formatting rules recalculate in real time and increase workbook size by measurable margins.
Best Practice Recommendation
Formulas provide transparency.
Conditional Formatting improves visual scanning.
Power Query ensures scalability and repeatability.
Combining methods increases detection accuracy and audit reliability.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to delete duplicate rows based on one column
Answers · 1
What is the formula to compare two columns for duplicates
Answers · 0
How to count in excel without duplicates
Answers · 0
How to color code duplicates in excel
Answers · 1