How to merge duplicate data in excel
Tutor 5 (73 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Merging duplicate data in Excel involves combining repeated entries into a single record while keeping or summarizing relevant information. The method depends on whether you want to keep all data, sum numeric values, or consolidate text.
Method 1: Using the Remove Duplicates Tool
-
Select the range of cells containing your data.
-
Go to the Data tab on the ribbon.
-
Click Remove Duplicates.
-
In the dialog box, select the columns to check for duplicates.
-
Click OK.
-
Excel will remove duplicate rows, keeping only the first instance.
Note: Only the first entry of a duplicate is kept. Other data in the removed rows is lost.
Method 2: Using Conditional Formatting to Identify Duplicates
-
Select the range of cells you want to check.
-
Go to the Home tab → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
-
Choose a color to highlight duplicates.
-
Manually review and merge duplicate entries as needed.
Example: Highlight duplicate customer names in a sales list to check if numeric totals or contact info need to be consolidated.
Method 3: Using the SUMIF Function to Merge Numeric Data
-
Suppose Column A contains duplicate names, and Column B contains sales amounts.
-
In a new column, enter the formula:
=SUMIF(A:A, A2, B:B)
-
Drag the formula down to sum all values for each duplicate entry.
-
Copy the results and use Paste Values to replace formulas with the totals.
-
Use Remove Duplicates on Column A to leave only unique names with combined totals.
Method 4: Using Power Query to Merge Duplicates
-
Select your data range.
-
Go to Data → Get & Transform Data → From Table/Range.
-
In Power Query, select the column(s) to identify duplicates.
-
Click Group By.
-
Choose the operation for other columns, such as Sum, Count, or All Rows.
-
Click Close & Load to return the cleaned data to Excel.
Example: Merge sales records by customer ID, summing up total sales while keeping a single row per customer.
Method 5: Using CONCATENATE or TEXTJOIN for Merging Text
-
Suppose duplicates appear in Column A, and related notes are in Column B.
-
Use the formula to combine text from duplicates:
=TEXTJOIN(", ", TRUE, IF(A:A=A2, B:B, ""))
-
Press Ctrl + Shift + Enter if using older Excel versions.
-
Copy and paste values, then remove duplicates in Column A.
Example: Combine multiple notes for the same customer into a single cell.
Tips for Managing Duplicates
-
Always back up your data before removing duplicates.
-
Use sort to group duplicates before merging.
-
Consider Power Query for large datasets, as it handles complex merges efficiently.
-
Keep a log of merged data to prevent accidental loss of information.
This approach ensures duplicate data is merged efficiently, numeric values are summarized, and text or notes are preserved.
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 show duplicates in red
Answers · 1
How to apply duplicate conditional formatting rule
Answers · 1
How to duplicate conditional formatting excel
Answers · 1
What is excel conditional formatting duplicates
Answers · 1