LEN counts spaces too. To count just the visible characters — for character limits, density, or validation — subtract the spaces with a LEN/SUBSTITUTE pair.
The example
Total vs non-space characters.
| A | B | |
|---|---|---|
| 1 | Text | No-space count |
| 2 | a b c d | 4 |
The formula
Length after removing spaces:
How it works
Strip spaces, then count:
SUBSTITUTE(A2, " ", "")removes every space.LEN(…)measures the result — the count of non-space characters.- To count spaces instead, subtract:
LEN(A2) − LEN(SUBSTITUTE(A2," ","")). - That space count plus one is also the rough word count for single-spaced text.
All whitespace, not just spaces? Tabs and non-breaking spaces (CHAR(9), CHAR(160)) aren’t the regular space — SUBSTITUTE those too, or TRIM/CLEAN first, for a true visible-character count.
Try it: interactive demo
Type text.
Variations
Count spaces
How many spaces:
Word count
Spaces + 1:
All whitespace
Also tabs/nbsp:
Pitfalls & errors
Only regular spaces. CHAR(160) (non-breaking) and CHAR(9) (tab) survive — substitute them too for a true count.
Empty cell. Returns 0, which is correct.
Word count needs TRIM. Double spaces inflate the spaces-plus-one word count — TRIM first.
Practice workbook
Frequently asked questions
How do I count characters without spaces in Excel?
How do I count the number of spaces?
Why doesn't it catch tabs or non-breaking spaces?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class