How to combine duplicate rows in excel
Tutor 5 (91 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
Combining duplicate rows in Excel is done to consolidate data, sum values, or merge text from rows that share the same key.
Step 1: Identify Duplicate Rows
Select the column or columns that may contain duplicates.
Go to Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
Choose a formatting style and click OK.
This will highlight all duplicate entries for easier identification.
Step 2: Remove Exact Duplicate Rows (Optional)
Select the entire data range.
Go to Data → Remove Duplicates.
Choose the columns to check for duplicates.
Click OK.
This removes entire duplicate rows, keeping only one instance of each.
Step 3: Combine Data for Duplicates
To combine data rather than delete duplicates, use Pivot Tables or Formulas.
Using a Pivot Table
Select the entire data range.
Go to Insert → Pivot Table → New Worksheet.
Drag the column with duplicates to Rows.
Drag numeric columns to Values and choose Sum or Average.
Drag text columns to Values, then change Value Field Settings → Summarize by → Max or use a formula helper column.
Using Formulas (SUMIF, TEXTJOIN)
Summing numeric values for duplicates:
=SUMIF(A:A, A2, B:B)
Explanation: Sums values in column B where column A matches the value in A2.
Combining text for duplicates (Excel 2019 and later or Excel 365):
=TEXTJOIN(", ", TRUE, IF(A:A=A2, C:C, ""))
Explanation: Combines text from column C where column A matches A2, separated by a comma. Use Ctrl+Shift+Enter in older versions to enter as an array formula.
Step 4: Remove Original Rows (Optional)
After combining, filter the original column and delete rows that were duplicates to avoid redundant data.
Step 5: Verify the Combined Data
Ensure all duplicate entries are properly consolidated, and sums or concatenations match expected results.
Notes
On Mac, menus are the same, but Data → Remove Duplicates may appear under Tools → Remove Duplicates depending on the Excel version.
TEXTJOIN is not available in versions earlier than Excel 2019.
This method ensures that duplicates are consolidated while preserving all important numeric and text data.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
What is the formula to highlight duplicate values
Answers · 1
What is the formula to remove duplicates
Answers · 1
How to delete duplicate values in excel
Answers · 1
How to delete duplicate rows based on one column
Answers · 1