How-Tos Productivity Downloads About

COUNTIF Counts Blanks When It Should Not

COUNTIF returns a bigger number than the visible entries, because it counts cells that look blank but are not. Formulas that return empty text and stray spaces both fool the count.

a calm adult at a desk with a real Windows laptop, the screen showing a spreadsheet with a COUNTIF formula and fully legible cell values, the person checking the count. No black screen, no blank white screen, no fake ...

TL;DR / Quick Fix

Quick fix: change the COUNTIF condition to count only non-empty visible entries, such as counting cells not equal to empty text. Then clean the range of stray spaces and formula blanks, and recount to confirm and spot-check the result by eye.

Follow these steps

  1. Understand what looks blank. A cell with a formula returning empty text looks blank but is not empty. COUNTIF counts it, which inflates the total.
  2. Count non-blank properly. Use a condition that excludes both truly empty cells and formula blanks. The right condition depends on your app, so test it on a small range first.
  3. Find the fake blanks. Select the range and look for cells with spaces or formulas. Those invisible contents are what the count caught.
  4. Clean stray spaces. Remove leading and trailing spaces from the data. A space makes a cell non-blank to every counting function.
  5. Fix formulas that return empty text. Change formulas to return a true blank or a clear marker instead of empty text. Clean source data counts correctly everywhere.
  6. Recount and compare with your eyes. Count a small section by eye and compare with the formula. Agreement on a sample means the fix worked.
A person performing step 1 of the guide: Understand what looks blank. A cell with a formula returning empty text looks blank but is not empty. COUNTIF counts it, which inflates the total.
Step 1 in action: Understand what looks blank. A cell with a formula returning empty text looks blank but is not empty. COUNTIF counts it, which inflates t...

What NOT to do

  • Do not trust a count you have not spot-checked. One eye-counted sample catches inflated totals fast.
  • Do not leave fake blanks in the data. Cleaning the source fixes the count and every other formula that reads the range.
  • Do not use a fancier function to dodge cleaning. Clean data counts right with the simplest formula.
  • Do not count a whole column blindly. Limit the range to the data, since stray content far below inflates whole-column counts.

Frequently asked questions

Why does COUNTIF count blank cells?

Because those cells are not truly blank: they hold spaces or formulas returning empty text, which COUNTIF counts.

How do I count only real entries?

Use a condition that excludes empty text and clean the range of stray spaces and formula blanks.

Should I just eyeball the count?

For a final check, yes. An eye count on a sample confirms the formula tells the truth.

What to read next

About the author

By Juan Ibarra · Google IT Support Certified (Verified on Credly). See the About page for full author details.

Share this guide