How to Count Words in a Cell in Google Sheets
Count the spaces and add one: =IF(A2="",0,COUNTA(SPLIT(A2," "))). It returns the number of words in the cell.
=IF(A2="",0,COUNTA(SPLIT(A2," ")))
SPLIT breaks the text on spaces, COUNTA counts the pieces, and IF returns 0 for a blank cell.
How it works
A word count is really a count of space-separated chunks. SPLIT turns the sentence into separate cells at each space, and COUNTA counts how many non-empty pieces result. The IF guard returns 0 for empty cells so you don't get a misleading 1. If text may contain double spaces, clean it with TRIM first.
Variations
Handle extra or double spaces
=IF(A2="",0,COUNTA(SPLIT(TRIM(A2)," ")))
TRIM collapses repeated spaces so they don't inflate the count.
Count characters instead
=LEN(A2)
LEN returns the total number of characters including spaces.
Count characters without spaces
=LEN(SUBSTITUTE(A2," ",""))
SUBSTITUTE removes spaces first, then LEN counts the rest.
Examples
| Scenario | Formula |
|---|---|
| Word count of a comment | =IF(A2="",0,COUNTA(SPLIT(TRIM(A2)," "))) |
| Character length of a tweet draft | =LEN(A2) |
FAQ
Why does an empty cell show 1 word?
Without the IF guard, SPLIT returns one empty piece. Use the IF(A2="",0,...) version shown above.
How do I stop double spaces inflating the count?
Wrap the text in TRIM: COUNTA(SPLIT(TRIM(A2)," ")).
How do I count characters instead of words?
Use =LEN(A2) for all characters, or LEN(SUBSTITUTE(A2," ","")) to exclude spaces.