Site icon ExcelNotes

How to Sum Cells With Duplicates

Duplicates are those numbers appear more than once in a data range. You can combine the COUNTIF and SUMPRODUCT functions to calculate the sum of cells with duplicates.

Example: You are working with a worksheet with the product in column A, the amount in column B, and the profit/loss in column C.

Questions: What is the sum of the values with duplicates in column B?

=SUMPRODUCT(–(COUNTIF(B2:B10, B2:B10)>1), B2:B10)

The result returns 2,500. There are five cells having duplicates: B3 (800), B4 (800), B7 (300), B8 (300) and B9 (300).

Explanation:

AmountStep 1Step 2Step 3
1,2781False0
8002True1
8002True1
5881False0
5001False0
3003True1
3003True1
3003True1
2001False0

Notes: The SUMPRODUCT Function

The SUMPRODUCT function adds all the multiplication results for all arrays.

Formula:

=SUMPRODUCT(array1, [array2], …)

Explanations:

– Array1 is required; the first array is to multiply and add.
– Array2 is optional; the second array is to multiply and add.

Exit mobile version