Site icon ExcelNotes

How to Count Cells without Duplicates

When working with data, it is common to have duplicate values in a range. Please check here to count the number of unique values in a range. In this post, we will figure out how to count the number of cells without duplicates in a range, or the numbers only appear once.

The COUNTIF function counts the number of cells that meet a criterion, and the SUMPRODUCT function returns the product of numbers in an array.

Example: In the following database, the first name is in column A, the last name is in column B, and the salary is in column C.

Formula 1: To count the number of cells without duplicates in column B

=SUMPRODUCT(–(COUNTIF(B2:B12,B2:B12)=1))
=SUMPRODUCT((COUNTIF(B2:B12,B2:B12)=1)*1)

In the example, there are three values in column B that have no duplicates.

Formula 2: To count the number of cells in column C that have no duplicates

=SUMPRODUCT(–(COUNTIF(C2:C12,C2:C12)=1))
=SUMPRODUCT((COUNTIF(C2:C12,C2:C12)=1)*1)

In the example, four values in column C have no duplicates.

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 then add.
– Array2 is optional; the second array is to multiply and then add.

Exit mobile version