KutoolsforOffice — One Suite. Five Tools. Get More Done.

Count Distinct Values While Ignoring Empty Cells in Excel

AuthorSiluviaLast modified

When an Excel list contains duplicate entries and blank cells, counting the number of different values can be difficult. Functions such as COUNTA count every nonempty cell, including duplicates, while manually removing duplicate records may alter the original data.

The Count distinct values ignoring empty cells formula in Formula Helper Plus provides a more convenient solution. Simply select the data range, and Formula Helper Plus automatically generates the required formula to count each nonempty value only once—without requiring you to write or memorize a complex formula.


Advantages of Count Distinct Values Ignoring Empty Cells

This formula is useful when you need to determine how many different customers, products, employees, departments, or other entries appear in a range containing both duplicates and blank cells.

Its main advantages include:

Count each value only once

Repeated entries are treated as a single distinct value, regardless of how many times they appear.

 
Ignore empty cells automatically

Blank cells in the selected range are excluded from the result automatically.

 
Preserve the original data

There is no need to remove duplicates, filter the list, or modify the source records.

 
Select the range directly

Choose the source range directly from the worksheet instead of editing cell references inside a complex formula.

 
Generate the formula automatically

Formula Helper Plus creates the appropriate formula automatically based on the selected range.

 
Keep the result up to date

The distinct count automatically recalculates whenever values in the referenced range change.


How to Count Distinct Values While Ignoring Empty Cells in Excel

In this example, a customer order list contains 50 order records. Some customers placed multiple orders, while some records have no customer assigned. We’ll count the number of distinct customers in the Customer column without including the empty cells.

a screenshot showing the sample data

To count the distinct customers while ignoring the empty cells without manually writing a formula, follow these steps.

Step 1: Select the output cell

First, select the cell where you want the distinct-value count to appear. The generated formula will be inserted directly into this cell.

Step 2: Open Formula Helper Plus

Select Kutools > Formula Helper > Formula Helper Plus.

a screenshot showing how to open the formula helper plus dialog box

Step 3: Find the formula and configure the argument

Formula Helper Plus organizes formulas into categories and also provides a search box, making it easier to locate the required formula without knowing its syntax.

In the dialog box:

  1. Shift to the Local tab.
  2. Select Count in the Category list.
  3. Select Count distinct values ignoring empty cells from the Formula list.
    Alternatively, enter a keyword such as distinct in the search box to locate the formula more quickly.
  4. Click inside the Range box, and then select the cells you want to check for distinct nonempty values. Exclude the column heading.
  5. Click OK.
    a screenshot showing how to find and configure the formula

Result

Formula Helper Plus inserts the formula into the output cell and immediately returns the number of distinct nonempty customers.

In this example, the result is 14. Customers with multiple orders are counted only once, while empty cells are excluded from the result.

a screenshot showing the results

Tips for Counting Distinct Values

The accuracy of the result depends on the data contained in the selected range. Entries that look identical or blank may contain subtle differences that cause Excel to treat them as separate values.

Follow these practices when counting distinct values:

Exclude the column heading

Select only the data cells. If the heading is included, it may be counted as another distinct value.

 
Check cells that only appear empty

A cell containing a space, an invisible character, or other hidden content is not truly empty and may be included in the count.

 
Remove unnecessary spaces from text

For example, Northstar Retail and Northstar Retail may be treated as different values when one entry contains a trailing space.

 
Keep the source data consistent

Use consistent spelling, punctuation, and data types throughout the selected range. Variations such as Maple & Co. and Maple and Co. are counted as different values.

 
Update the range when adding new records

If new data is entered below the referenced range, expand the formula range so that the new records are included in the calculation.


FAQ – Frequently Asked Questions

The following questions address common issues when counting distinct values while excluding empty cells.

Does the formula count duplicate values more than once?

No. Each distinct nonempty value is counted only once, even if it appears multiple times in the selected range.

Are empty cells included in the result?

No. Truly empty cells are ignored and do not increase the distinct-value count.

Why is a cell that looks empty being counted?

The cell may contain a space, a hidden character, or other invisible content. Delete the cell contents completely or clean the source data before counting again.

Are uppercase and lowercase versions counted as different values?

No. The generated formula is not case-sensitive, so entries such as Northstar Retail and NORTHSTAR RETAIL are generally treated as the same value.

Can the formula count both text and numeric values?

Yes. The selected range can contain both text and numeric values. However, keeping the data type consistent helps prevent the same value from being stored and interpreted differently.

Will the result change when the source data is edited?

Yes. Because Formula Helper Plus inserts a formula rather than a fixed value, the result recalculates automatically whenever data within the referenced range changes.

Will newly added records be counted automatically?

Only if the new records are within the range referenced by the formula. If data is added outside the original range, update the referenced range so the new records are included in the calculation.


Conclusion

The Count distinct values ignoring empty cells formula makes it easy to count each nonempty value only once in a range containing duplicates and blanks. With Formula Helper Plus, you only need to select the source range to generate the formula and obtain a dynamic result—without writing or memorizing complex formula syntax.


Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in

Table of contents



Kutools for Excel

Brings 300+ powerful features to streamline your Excel tasks.