How to count unique values or numbers in a column in Excel?
Assuming you have a list of values in a range of the worksheet, and now you want to know how many unique values are there. If you identify and count them one by one, it will waste a lot of times. So here I will introduce you some quick tricks to deal with this problem.
Count the number of unique values with Formulas
Count the number of unique values with Advanced Filter
Count the number of unique values with Kutools for Excel
Count the number of unique values with Formulas
There are some formulas can help you to quickly count the number of unique values in a range. If your data are numbers, for example, you have a column of numbers in range (A1:A10), see screenshot:
You can use the following formulas, please do as this:
1. Enter this formula =SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10)) into a blank cell.
2. Then press Enter key, and the number of the unique value will be displayed. See screenshot:
Tips: 1. Here is another formula =SUM(IF(FREQUENCY(A1:A10, A1:A10)>0,1)) also can help you. Please apply anyone as you like. Both of the above formulas will count the unique values including the first duplicate as well.
2. If there are a range of text in your worksheet, the above formulas will not work, you should use this array formula: =SUM(IF(FREQUENCY(IF(LEN(A1:A10)>0,MATCH(A1:A10,A1:A10,0),""), IF(LEN(A1:A10)>0,MATCH(A1:A10,A1:A10,0),""))>0,1))
After enter the formula, then remember to press Shift + Ctrl + Enter keys, and the number of unique values has been displayed.
Notes:
- 1. The range A1:A10 in the above formulas are variable, you can change them as you need.
- 2. This formula also count the unique values including the first duplicate.
- 3. This formula works in a range of text and numbers as well.
Count the number of unique values with Advanced Filter
You can also use the Advanced Filter to extract the unique values from a column of data and paste them to a new location. Then with the ROWS function to count the number of unique values in the new range. The specific steps are as follows:
1. Click Data tab in the ribbon, and then click Advanced command, see screenshot:
2. And in the Advanced Filter dialog box:
|
3. After finishing the settings, click OK, the unique values have been listed in a new column, see screenshot:
4. Then in a blank cell, enter the short formula =ROWS(E1:E8),and press Enter key on the keyboard. And the number of the unique values will be displayed.
Count the number of unique values with Kutools for Excel
Here, I will recommend you a useful tool- Kutools for Excel, with its Select Duplicate & Unique Cells function, you can quickly select the duplicate values or unique values and count the number of them.
Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. |
After installing Kutools for Excel, please do with the following steps:
1. Select the data range that you want to count the unique values.
2. Then click Kutools > Select > Select Duplicate & Unique Cells, see screenshot:
3. In the Select Duplicate & Unique Cells dialog box, choose Unique values only or All unique (Including 1st duplicates) as you want, at same time, you can also highlight the unique values by checking Fill backcolor or Fill font color under the Processing of results section, see screenshot:
4. (1.) If you choose Unique values only, only the unique values will be counted and selected at once. See screenshot:
(2.) If you choose All unique (Including 1st duplicates), all unique values which including the first duplicates will be counted and selected as following screenshot shown:
Click to know more about this Select Duplicate & Unique Cells feature.
Download and free trial Kutools for Excel Now !
Demo: Count the number of unique values with Kutools for Excel
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Download and free trial Now!
Related article:
How to filter or select unique records from selected range in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!