How to Sum Duplicates in Excel: 3 Easy Methods (2024 Guide)

Published: October 30, 2024 - 6 min read

Frank Ferris

Excel users often need to sum values associated with duplicate entries. This guide shows you how to sum duplicates in Excel using three effective methods.

How to Sum Duplicates in Excel: Step-by-Step Tutorial

Let’s explore three powerful methods to sum duplicates in Excel: SUMIF, SUMIFS, and PivotTables. Each approach offers unique advantages for different scenarios.

Method 1: Using the SUMIF Function

The SUMIF function is ideal for summing duplicates based on a single criterion. Here’s how to use it:

Step 1: Open your Excel spreadsheet.

  • Launch Excel and open the workbook containing your data.
  • Ensure your data is organized in columns, with one column for the duplicate values and another for the values to sum.

Step 2: Identify the relevant columns.

  • Locate the column containing the duplicate values (e.g., Column A).
  • Find the column with the values you want to sum (e.g., Column B).

Step 3: Use the SUMIF function.

  • Click on an empty cell where you want the result to appear.
  • Enter the following formula: =SUMIF(A:A,A2,B:B)
A screenshot showing a formula that sums all the values in column B where the corresponding value in A matches A2.
  • This formula sums all values in Column B where the corresponding value in Column A matches A2.

Step 4: Apply the formula.

  • Press Enter to see the result for the first unique value.
  • Copy the formula down to cover all unique values in your dataset.

Step 5: Extend for multiple criteria (if needed).

  • If you need to sum based on multiple criteria, consider using SUMIFS (covered in Method 2).

Method 2: Utilizing SUMIFS for Multiple Criteria

When you need to sum duplicates based on multiple conditions, SUMIFS is the go-to function. Here’s how to implement it:

Step 1: Prepare your data.

  • Organize your data with separate columns for each criterion.
  • Ensure you have a column for the values you want to sum.

Step 2: Construct the SUMIFS formula.

  • Click on an empty cell for your result.
  • Enter the formula: =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2, …])
  • For example: =SUMIFS(C:C, A:A, A2, B:B, B2)
A screenshot of a formula returning zero
  • This sums values in Column C where Column A matches A2 AND Column B matches B2.

Step 3: Apply the formula to sum duplicates.

  • Press Enter to calculate the sum for the first set of criteria.
  • Copy the formula down to cover all unique combinations in your dataset.

Step 4: Adjust as needed.

  • Modify the formula to include additional criteria ranges and criteria as required.
  • Ensure all ranges and criteria are correctly referenced.

Method 3: Creating a PivotTable to Sum Duplicates

PivotTables offer a visual and interactive way to sum duplicates. Follow these steps:

Step 1: Select your data range.

  • Highlight the entire dataset you want to analyze.
  • Ensure your data has headers for each column.

Step 2: Insert a PivotTable.

  • Click “Insert” in the top menu, then select “PivotTable.”
Selecting 'Pivot table' from the menu.
  • Choose where you want the PivotTable to appear (new worksheet or existing location).
Like in the table range and where to place a pivot table in the Create Pivot Table menu.

Step 3: Set up the PivotTable fields.

Setting up the pivot table fields.
  • In the PivotTable Fields pane, drag the field with duplicate values to the “Rows” area.
  • Drag the field containing values to sum to the “Values” area.

Step 4: Adjust Value Field Settings.

  • Right-click on the sum field in the Values area.
  • Select “Value Field Settings” and ensure the “Sum” function is selected.
Selecting 'Summarize by Sum' from the PivotTable Fields.

Step 5: Refresh and update.

  • Right-click anywhere in the PivotTable and select “Refresh” to update results.
Selecting 'Refresh' from the menu.
  • The PivotTable now displays summed values for each unique entry.

How do I sum up all duplicates in Excel?

For a quick summary of duplicates across your entire dataset, use Excel’s Consolidate feature:

Step 1: Prepare your data.

Coefficient Excel Google Sheets Connectors
Try the Free Spreadsheet Extension Over 500,000 Pros Are Raving About

Stop exporting data manually. Sync data from your business systems into Google Sheets or Excel with Coefficient and set it on a refresh schedule.

Get Started
  • Ensure your data is organized in a tabular format with headers.

Step 2: Use the Consolidate feature.

  • Select “Data” from the top menu, then click “Consolidate.”
Clicking "Data" and then clicking "Consolidate" from the Excel menu
  • In the Function dropdown, select “Sum.”
Selecting sum as the function in the drop-down menu

Step 3: Set your reference range.

  • Click in the Reference field and select your entire dataset.
Entering a formula in the reference range...
  • Click “Add” to include this range in the consolidation.
Clicking the - or + button in the All References panel.

Step 4: Apply labels and create links.

  • Check “Top row” and “Left column” if your data has labels.
Using labels in the top row of the left column.
  • Select “Create links to source data” for dynamic updates.

Step 5: Review the results.

  • Click “OK” to generate the consolidated summary.
  • Selecting 'Okay' from the menu.
  • Verify that the summed values match your expectations.

How to combine duplicate rows and sum the values in Excel?

To combine duplicate rows and sum their corresponding values:

Step 1: Sort your data.

  • Select your entire dataset.
  • Sort by the column containing duplicate values.

Step 2: Use SUMIF with ROW function.

  • In a new column, enter this formula: =SUMIF($A$2:$A$2, A2, $B$2:$B$2)
  • Replace A with your duplicate column and B with your value column.
A screenshot of a cell returning the value 3750 formula

Step 3: Create a helper column.

  • In another new column, use this formula: =IF(COUNTIF($A$2:A2, A2)=1, ROW(), “”)
Screenshot of the cell returning 3 from a formula
  • This identifies the first occurrence of each unique entry.

Step 4: Apply array formulas.

  • Select a range equal to your data’s row count.
  • Enter this array formula: =IF(ROW(A1)=LARGE(IF($A$2:$A$100=A2, ROW($A$2:$A$100)), COUNTIF($A$2:A2, A2)), B2, “”)
  • Press Ctrl+Shift+Enter to enter as an array formula.

Step 5: Remove duplicates.

  • Copy and paste values from the array formula results.
  • Use Excel’s “Remove Duplicates” feature on this new data.
A screenshot of selecting "Remove duplicates" from the menu.

Advanced Excel Functions for Summing Duplicates

For more complex scenarios, consider these advanced techniques:

  1. SUMPRODUCT for complex criteria: =SUMPRODUCT((A2:A100=”Criteria”)*(B2:B100>0), C2:C100)
  2. INDEX and MATCH with SUM: =SUM(INDEX(C:C, MATCH(0, COUNTIF($A$1:A1, A:A), 0)):INDEX(C:C, MATCH(0, COUNTIF($A$1:A1, A:A), 1)))
  3. Array formulas for flexibility: {=SUM(IF(FREQUENCY(IF(A2:A100<>””,MATCH(A2:A100,A2:A100,0)),ROW(A2:A100)-ROW(A2)+1),B2:B100))}
  4. Power Query for large datasets: Use Power Query to group by duplicate columns and sum values, then load results back to Excel.
  5. VBA for automation: Develop custom VBA functions to sum duplicates across multiple worksheets or with complex logic.

Mastering Duplicate Summing in Excel

By mastering these methods, you can efficiently sum duplicates in Excel for various scenarios. Choose the approach that best fits your data structure and requirements.

Ready to take your Excel data management to the next level? Try Coefficient to seamlessly sync and analyze your data. Get started with Coefficient today and transform how you work with Excel.

Sync Live Data into Your Spreadsheet

Connect Google Sheets or Excel to your business systems, import your data, and set it on a refresh schedule.

Try the Spreadsheet Automation Tool Over 500,000 Professionals are Raving About

Tired of spending endless hours manually pushing and pulling data into Google Sheets? Say goodbye to repetitive tasks and hello to efficiency with Coefficient, the leading spreadsheet automation tool trusted by over 350,000 professionals worldwide.

Sync data from your CRM, database, ads platforms, and more into Google Sheets in just a few clicks. Set it on a refresh schedule. And, use AI to write formulas and SQL, or build charts and pivots.

Frank Ferris Sr. Manager, Product Specialists
Frank is the spreadsheet ninja you never knew existed. Frank's focus throughout his career has been all about growing businesses quickly through both strategy and effective operations. His advanced skillset and understanding of how to leverage data analytics to automate processes and make better and faster decisions make him the unicorn any team can thrive with.
500,000+ happy users
Wait, there's more!
Connect any system to Google Sheets in just seconds.
Get Started Free

Trusted By Over 50,000 Companies