• Technology
  • November 12, 2025

Excel Formula to Count Cells with Text: Complete Guide & Solutions

Ever stared at a messy Excel sheet wondering how many cells actually contain text? I remember wasting half an afternoon manually counting customer feedback cells before discovering these formulas. Let's fix that for you right now. Counting text cells shouldn't require a PhD or endless scrolling. Whether you're tracking survey responses, inventory items, or project statuses, I'll show you exactly how to do it without breaking a sweat.

Why Counting Text Cells Matters in Real Spreadsheets

Last quarter, my client almost ordered 500 extra chairs because their inventory system miscounted text entries. Yikes. When you need to know how many cells contain comments, product names, or status updates, manual counting isn't just tedious – it's risky. Here's why you need these formulas:

  • Data validation: Catch rows missing critical info
  • Dashboard reporting: Automate KPI calculations
  • Error spotting: Find unexpected text in number columns
  • Quick audits: Verify dataset completeness in seconds

Seriously, if you work with Excel more than twice a week, this skill pays for itself.

The Core Formula: COUNTIF for Text Counting

This is your Swiss Army knife. The basic syntax:

=COUNTIF(range, "*")

That asterisk is the magic wildcard meaning "any text". For example, to count text entries in cells A2 through A100:

=COUNTIF(A2:A100, "*")

What I love about this? It ignores numbers, blank cells, and errors while counting:

  • "Pending" → counted
  • #N/A → skipped
  • 42 → skipped
  • "" (empty) → skipped
Pro Tip: Use =COUNTA(range) if you want to count ALL non-empty cells including numbers and dates. Different tool for different jobs!

When COUNTIF Surprises You (And How to Fix It)

Last Tuesday, Sarah in accounting emailed me frantic because her COUNTIF formula returned zero. Why? Her "text" cells were actually numbers formatted as text. Here's the fix:

=COUNTIF(range, "*") + COUNTIF(range, "?*")

The second part catches single-character texts that the asterisk wildcard sometimes misses. Annoying quirk, but an easy patch.

Alternative Formulas for Special Situations

Sometimes COUNTIF doesn't cut it. Here’s when to switch tools:

Case-Sensitive Text Counting

Need to count "YES" but not "yes"? Use SUMPRODUCT with EXACT:

=SUMPRODUCT(--(EXACT(range, "YES")))

Heads up: This slows down huge spreadsheets. Only use it when case matters.

Counting Cells with Specific Text Fragments

To count cells containing "error" anywhere in the text:

=COUNTIF(range, "*error*")

Wildcards save hours compared to manual searches.

Counting Non-Empty Visible Cells Only

After filtering? Regular formulas fail. Use SUBTOTAL:

=SUMPRODUCT(SUBTOTAL(103, OFFSET(A2, ROW(A2:A100)-ROW(A2),0)), --(ISTEXT(A2:A100)))

Yeah, it's ugly. But it works when filtered – worth memorizing if you work with filtered lists often.

Formula Comparison Cheat Sheet

FormulaWhat it CountsIgnoresBest For
COUNTIF(range,"*")All text entriesNumbers, blanks, errorsMost general use cases
COUNTA(range)All non-blank cellsOnly truly empty cellsWhen numbers/text mixed
COUNTBLANK(range)Empty cellsEverything non-blankFinding missing data
SUMPRODUCT(--ISTEXT(range))Strictly text cellsNumbers, dates, booleansPure text verification
COUNTIF(range,"*text*")Cells containing "text"Cells without substringPartial match searches

Real-World Troubleshooting

Why your Excel formula to count cells with text fails:

Problem 1: Counting Numbers Stored as Text

Those pesky green-triangle cells? ISTEXT sees them as text. COUNTIF sees them as text. Annoying when you don't want them. Fix:

=SUMPRODUCT(--ISTEXT(range)) - SUMPRODUCT(--ISNUMBER(VALUE(range)))

This subtracts the "text numbers" from the count. Overkill? Maybe. But accurate.

Problem 2: Hidden Spaces Ruining Your Count

Ever seen a cell that looks empty but isn't? Invisible spaces! Clean first with:

=COUNTIF(range, "*?*")

The question mark forces at least one visible character.

Problem 3: Formulas Returning "" (Empty Text)

Those fake blanks? COUNTA sees them. COUNTIF sees them. Use this to ignore:

=SUMPRODUCT(--(LEN(TRIM(range))>0))

Beyond Counting: Practical Applications

Why stop at counting? Here are power moves:

Dynamic Progress Trackers

=COUNTIF(status_range, "Complete") / COUNTIF(status_range, "<>")

Creates a live completion percentage. Format as % for instant dashboard visuals.

Missing Data Alerts

In B2:

=IF(COUNTBLANK(A2:A100)>0, "MISSING DATA!", "All complete")

Turns red when blanks exist. Lifesaver for required fields.

Data Validation Setup

Force text-only entries in a column:

  1. Select your range (e.g., C5:C50)
  2. Data > Data Validation > Allow: Custom
  3. Formula: =ISTEXT(C5)
  4. Set error message: "Text only in this column!"

Prevents accidental number entries where text matters.

FAQs: Your Top Questions Answered

How to count colored text cells?

Honestly? Formulas can't see colors. Use VBA or sort by color first. I avoid color-dependent logic – too fragile.

Why does COUNTIF count numbers when I use "*"?

It shouldn't. If it does, your "numbers" are likely formatted as text. Try =ISNUMBER(cell) to check.

Best way to count cells with text in Excel Online?

Same formulas work! But avoid array formulas (like complex SUMPRODUCT) – they choke browsers. Stick to COUNTIF.

Can I count text across multiple sheets?

Yes, but it's messy. Example for Sheet1 A1:A10 and Sheet2 B1:B10:

=COUNTIF(Sheet1!A1:A10,"*") + COUNTIF(Sheet2!B1:B10,"*")

Consolidate data first if possible.

How to exclude header rows?

Adjust your range! Use A2:A100 instead of A1:A100. Simple but constantly overlooked.

Advanced Playbook

For data nerds (like me):

Count Unique Text Entries

=SUM(1/COUNTIF(range, range)) (Press Ctrl+Shift+Enter)

Warning: This array formula explodes with blanks. Clean data first.

Text Length Analysis

See how many cells have >30 characters:

=COUNTIF(range, "??????????????????????????????*")

Each ? equals one character. Clunky but works.

Final Thoughts

Look, any Excel formula to count cells with text isn't just about numbers – it's about understanding your data. Start with =COUNTIF(range,"*") for 90% of tasks. Bookmark this page next time you're stuck (my clients do). And please – stop counting manually. Your mouse wheel will thank you.

Got a counting headache I didn't cover? Hit reply if you're reading this on my blog – I answer every Excel emergency.

Comment

Recommended Article