## Count Unique Values in Excel

To count only unique values in excel, we can adopt several options, and the top ones are shown below.

- Count unique values using
**Sum and Countif function.** - Count unique values using
**SUMPRODUCT and Countif function.**

Now let us discuss each of the methods in detail along with an example –

### #1 Count Unique Values using SUM and COUNTIF Function

Assume you are working as a sales manager, and you have sales data in front of you. Many customers purchased the product at multiple time frame in the month. You need total customers in the month.

In this example, I will discuss the method of counting unique values using the SUM function in excelSUM Function In ExcelThe SUM function in excel adds the numerical values in a range of cells. Being categorized under the Math and Trigonometry function, it is entered by typing “=SUM” followed by the values to be summed. The values supplied to the function can be numbers, cell references or ranges.read more with the COUNTIF functionCOUNTIF FunctionThe COUNTIF function in Excel counts the number of cells within a range based on pre-defined criteria. It is used to count cells that include dates, numbers, or text. For example, COUNTIF(A1:A10,”Trump”) will count the number of cells within the range A1:A10 that contain the text “Trump” read more.

Below are the steps used to find count unique values using sum function –

**Copy the below data to your excel file.****Apply the below formula in the cell E3 to get the total unique values.**

Now let me break down the formula in detail.

The formula I have used here is:

If you take a close at the formula, it is surrounded by curly brackets. It is not entered by me; rather, it is an indication that it is an array formula.

Once you finished with the formula before we hit enter, we need to use the key:

**Ctrl + Shift + Enter **this would enter those curly brackets automatically for you.

This is a bit new formula if you are working with array formulas in excelArray Formulas In ExcelArray formulas are extremely helpful and powerful formulas that are used in Excel to execute some of the most complex calculations. There are two types of array formulas: one that returns a single result and the other that returns multiple results.read more for the first time. Let me break down the formula into three pieces.

Firstly I will explain the COUNTIF formulaExplain The COUNTIF FormulaThe COUNTIF function in Excel counts the number of cells within a range based on pre-defined criteria. It is used to count cells that include dates, numbers, or text. For example, COUNTIF(A1:A10,”Trump”) will count the number of cells within the range A1:A10 that contain the text “Trump” read more. Select the countif formula part and press F9.

Now press the key **F9.**

Now we are dividing the above values by number 1.

Now Sum function add all those numbers that are appeared in the above image and gives the total as 12. Therefore the total number of unique values in the list is 12.

#### How Does Calculation work?

- If the values are there in the list two times, then it is ½, i.e., 0.5. If the value is there in the list three times, then it is 1/3, i.e., 0.3333.
- In our list, the first name is Ruturaj that is appearing three times in the list, so our result showing 0.33333333 as the value.
- Our second name Kamal appearing only one time, and the formula read like this 1/1 I .e.1 only.
- This COUNTIF and SUM function can give us the total number of unique values in the list.

### #2 Count Unique Values using SUMPRODUCT and COUNTIF Function

Take the same data from the previous example.

In this example, I will discuss the method of counting unique values using the SUMPRODUCT function Using The SUMPRODUCT FunctionThe SUMPRODUCT excel function multiplies the numbers of two or more arrays and sums up the resulting products.read more with the COUNTIF function. This is not an array formula I am going to use in this example rather a normal formula I am using.

**Step 1:**Copy the below data to your excel file.

**Step 2:**Apply the below formula in the cell E6 to get the total unique values.

Now let me break down the formula in detail.

The formula I have used here is:

In our previous example, I have used the Array formula, i.e., closing the formula with **Ctrl + Shift + Enter.**

If I break down the formula using the F9 key, it exactly works the same as the previous one.

Now SUMPRODUCT function adds all those numbers that are appeared in the above image and gives the total as 12. Therefore the total number of unique values in the list is 12.

### Handling Blanks in the Range

If the value list contains any of the empty cells, then the formula returns the result as an error in excelError In ExcelErrors in excel are common and often occur at times of applying formulas. The list of nine most common excel errors are - #DIV/0, #N/A, #NAME?, #NULL!, #NUM!, #REF!, #VALUE!, #####, Circular Reference.read more, i.e., #DIV/0!.

In the above image row, number 10 is the empty row. Since there is an empty row, the formula returned the result as an error, i.e., #DIV/0!.

We can handle these kinds of errors by inserting nothing ( “” ) value to it.

At the end of the countif formula, we need to nothing value by using an ampersand symbol then deduct the whole result by -1 because even the empty cell is treated as a unique value by the formula.

Note: If there are two empty rows, then we can use -2; if there are three empty rows, then we can use -3, and so on.

**Things to Remember**

- We need to use
**Ctrl + Shift + Enter**to close the formula in case of array formulas. Even when we are editing the formula, we cannot simply close the bracket; we need to**Ctrl + Shift + EnterCtrl + Shift + EnterCtrl-Shift Enter In Excel is a shortcut command that facilitates implementing the array formula in the excel function to execute an intricate computation of the given data. Altogether it transforms a particular data into an array format in excel with multiple data values for this purpose.read more.** - We can get the unique list just by removing duplicate values from the list.
- An array formula cannot be applied to merged cells.

### Recommended Articles

This has been a Guide to Count Unique Values in Excel. Here we use COUNTIF Function along with SUM and SUMPRODUCT to count unique values in Excel along with the excel template. You may also look at these useful functions in excel –

- Calculate SUMPRODUCT with Multiple Criteria
- COUNTIF with Multiple Criteria
- ISNA Function in Excel
- OFFSET Excel Example

- 35+ Courses
- 120+ Hours
- Full Lifetime Access
- Certificate of Completion