Count how many characters (including spaces) a cell contains.
Copy this formula
=LEN(A2)LEN returns the length of the text in a cell, counting letters, numbers, punctuation, and spaces. It's handy for validating IDs, tweets, or fixed-length codes.
=LEN("Hello")→5Five characters.
=LEN(TRIM(" Hello world "))→11TRIM removes leading, trailing and repeated spaces before counting.
=SUMPRODUCT(LEN(A2:A10))→184Total characters across a range.
Count without spaces
=LEN(SUBSTITUTE(A2, " ", ""))Removes spaces before counting.
Subtract lengths: =LEN(A2)-LEN(SUBSTITUTE(A2, ",", "")) counts commas.
Yes. Spaces, punctuation and digits all count as characters.
Use =LEN(TRIM(A2))-LEN(SUBSTITUTE(TRIM(A2), " ", ""))+1. It counts the spaces between words and adds one.
LEN counts the stored value, not the formatting. A date returns 5 because it is stored as a serial number such as 46000.
Need a formula for your own data?
Describe what you want in plain language and let ExcelGPT write, explain, and verify the formula — free to start, no plugin.