How to merge duplicate names in excel
Tutor 5 (73 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Merging duplicate names in Excel requires identifying duplicates first and then consolidating the data associated with them. This process ensures that repeated entries do not distort analysis or summaries.
Step 1: Identify Duplicate Names
-
Select the column containing names.
-
Go to Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
-
Choose a highlight color and click OK.
-
Excel will highlight all duplicate names in the selected column.
Step 2: Remove Exact Duplicate Entries
-
Select the range containing the names and any associated data.
-
Go to Data → Remove Duplicates.
-
In the dialog box, check the columns you want to consider for duplicates.
-
Click OK.
-
Excel will remove exact duplicates, keeping the first occurrence.
Step 3: Consolidate Data for Duplicate Names
If duplicates have associated numerical or other data that need combining:
-
Select the dataset.
-
Go to Data → PivotTable → From Table/Range.
-
Place the Name column in the Rows area.
-
Place numerical or relevant columns in the Values area.
-
Choose the aggregation function such as Sum, Average, or Count depending on the requirement.
This creates a summary table where each name appears once with combined data.
Step 4: Using Formulas to Merge Data (Alternative)
-
Create a list of unique names using Remove Duplicates or UNIQUE() in Excel 365:
=UNIQUE(A2:A100)
-
Use SUMIF() to combine numerical values for each name:
=SUMIF(A2:A100, D2, B2:B100)
-
A2:A100is the original name column. -
D2is the unique name. -
B2:B100is the associated data column.
-
Drag the formula down to calculate totals for all unique names.
Step 5: Optional – Merge Text Data
For text consolidation of duplicates, Excel requires a formula using TEXTJOIN():
=TEXTJOIN(", ", TRUE, IF(A$2:A$100=D2, B$2:B$100, ""))
-
This joins all associated text entries separated by a comma.
-
Press Ctrl+Shift+Enter for array formula in versions prior to Excel 365.
Notes
-
Conditional formatting only highlights duplicates, it does not remove them.
-
PivotTables are best for aggregating large datasets quickly.
-
Formulas allow more flexibility but may require manual adjustments for complex data.
-
Ensure all relevant columns are included when removing duplicates to avoid data loss.
This method ensures that duplicate names are merged properly while retaining or summarizing the associated data accurately.
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