Are you working with Excel and need to count unique values, excluding blank cells? You're in the right place. In this guide, we'll walk you through a simple, step-by-step process to achieve this using Excel's powerful built-in functions. Let's dive right in.
Why Count Unique Values Excluding Blanks?
Counting unique values, excluding blanks, is a common task in data analysis. It helps you understand the diversity of your data without being influenced by empty cells. This is particularly useful when you're working with large datasets and want to quickly identify the number of distinct, non-blank values in a column.
Using COUNTUNIQUE with IF Function
Excel's COUNTUNIQUE function, available in Office 365 and Excel 2021, makes this task a breeze. However, if you're using an older version, you can still achieve this with the help of the IF function. Let's explore both methods.

Method 1: Using COUNTUNIQUE Function
Here's how to use the COUNTUNIQUE function to count unique values, excluding blanks:
- Select a cell where you want the result to appear.
- Type the following formula:
=COUNTUNIQUE(A2:A10), replacing 'A2:A10' with the range of your data. - Press Enter. Excel will now count the unique values in the specified range, excluding any blank cells.
Method 2: Using IF Function
If you're using an older version of Excel, you can use the IF function along with the UNIQUE and COUNTA functions to achieve the same result. Here's how:
- Select a cell where you want the result to appear.
- Type the following formula:
=COUNTA(IF(A2:A10<>"", UNIQUE(A2:A10))), replacing 'A2:A10' with the range of your data. - Press Enter. Excel will now count the unique values in the specified range, excluding any blank cells.
Handling Duplicates and Non-Unique Values
Both methods above will count each unique value only once, excluding any duplicates. If you want to count the frequency of each value, you can use the FREQUENCY function or a pivot table. We'll cover these topics in detail in future articles.

Practical Example
Let's say you have the following data in Column A (A2:A10):
| Column A |
|---|
| Apple |
| Banana |
| Apple |
| Cherry |
| Banana |
| Apple |
| Date |
Using either of the methods above, you'll find that there are 4 unique values (Apple, Banana, Cherry, Date) in the range A2:A10, excluding the blank cells.
That's it! You've now learned how to count unique values, excluding blanks, in Excel. This skill will prove invaluable in your data analysis journey. Happy counting!























