How to combine duplicate rows and sum
Tutor 5 (112 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To combine duplicate rows in Excel and sum their values, follow these steps carefully. This method is effective for datasets where one or more columns have repeating entries, and you want to aggregate numeric values.
Step 1: Identify Duplicate Rows
Duplicate rows are rows that share the same value in one or more columns. For example, if you have a sales table:
| Product | Quantity | Price |
|---|---|---|
| A | 10 | 5 |
| B | 15 | 7 |
| A | 20 | 5 |
Product A appears twice.
Step 2: Use the "Remove Duplicates" Tool (Optional)
This step is optional if you want to remove duplicates without summing.
Select the range of your table.
Go to Data → Remove Duplicates.
Choose the columns to check for duplicates.
Click OK.
This will keep one row per unique value and remove others.
Step 3: Combine and Sum Using PivotTable
PivotTables are the most reliable method for combining duplicates and summing values.
Select your dataset.
Go to Insert → PivotTable.
Select where you want the PivotTable (New Worksheet is recommended).
Drag the column with duplicates (e.g., Product) to the Rows area.
Drag the numeric column you want to sum (e.g., Quantity) to the Values area.
Excel will automatically sum duplicates.
Result:
| Product | Sum of Quantity |
|---|---|
| A | 30 |
| B | 15 |
Step 4: Use the SUMIF Formula
For more control, you can use the SUMIF formula to sum values for duplicates without a PivotTable.
Formula:
=SUMIF(range_to_check, criteria, range_to_sum)
Example:
=SUMIF(A:A, "A", B:B)
A:A→ Column containing duplicate values"A"→ Specific value to sumB:B→ Column containing numeric values to sum
You can drag the formula down for all unique items.
Step 5: Advanced Option – Power Query
Power Query provides a dynamic way to combine duplicates and sum:
Select your dataset and go to Data → Get & Transform → From Table/Range.
Ensure your data is formatted as a table.
In Power Query, select the column with duplicates.
Click Group By.
Choose Sum for the column to aggregate.
Click Close & Load to output the results.
This method works well for large datasets and updates automatically if the source data changes.
Key Notes
PivotTables are best for quick aggregation.
SUMIFis better for formula-driven solutions where the result is dynamic in the sheet.Power Query is ideal for large or frequently updated datasets.
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
Why is drop down list not showing in excel
Answers · 0
Why is the drop down list not showing all options
Answers · 1
Why can't I delete drop down list excel
Answers · 1
How to create an Excel drop-down list from a lookup table
Answers · 1