Cellwise Try it free

Excel guide · 3 min read

How to count words in a cell in Excel

Quick answerUse =LEN(TRIM(A2))-LEN(SUBSTITUTE(A2," ",""))+1. It counts the spaces between words and adds one. TRIM removes extra spaces first so they are not counted as extra words. For cells that may be empty, use =IF(LEN(TRIM(A2))=0,0,LEN(TRIM(A2))-LEN(SUBSTITUTE(A2," ",""))+1).

Sample data

Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.

A
1Call note
2Left voicemail, call back Friday
3 Sent quote
4
5Approved
6Customer asked for a call-back
7Call back re: quote, then call accounts

Download this sheet as an Excel practice file (.xlsx)

The word count formula

Excel does not have a word count function or a word count in the status bar, so you count the gaps between words instead. TRIM collapses runs of spaces to single spaces and strips the ends. LEN of that, minus the length with every space removed, gives the number of spaces between words. Add 1, because three words have two gaps.

Note: the second LEN can use the original cell. Removing all spaces gives the same length either way.

=LEN(TRIM(A2))-LEN(SUBSTITUTE(A2," ",""))+1

Result: 5

Returns 5: Left, voicemail, call, back, Friday.

Why the TRIM matters

" Sent quote " has two words but six spaces. Without TRIM, the formula would count six gaps and say 7 words. With TRIM, the text becomes "Sent quote" first, which has one gap.

Data pasted from emails, web forms and CRMs is full of doubled and trailing spaces, so always keep the TRIM in.

=LEN(TRIM(A3))-LEN(SUBSTITUTE(A3," ",""))+1

Result: 2

Returns 2, despite the extra spaces.

Return 0 for empty cells

On an empty cell the basic formula still adds 1 and returns 1 word. Check for empty text first. Using LEN(TRIM()) also catches cells that hold nothing but spaces.

=IF(LEN(TRIM(A4))=0,0,LEN(TRIM(A4))-LEN(SUBSTITUTE(A4," ",""))+1)

Result: 0

Returns 0 for the empty cell A4.

Count words in a whole column

SUMPRODUCT runs the formula on every cell and adds the results. Multiplying by (LEN(TRIM(A2:A7))>0) turns empty cells into 0 instead of 1, so a blank row does not add a phantom word.

=SUMPRODUCT((LEN(TRIM(A2:A7))-LEN(SUBSTITUTE(A2:A7," ",""))+1)*(LEN(TRIM(A2:A7))>0))

Result: 20

Returns 20 words across the five notes. Without the empty-cell check it would say 21.

Count how many times a specific word appears

To count "call", remove it and see how many characters disappeared, then divide by the length of the word. UPPER on both sides makes it ignore case, so "Call" and "call" both count.

This counts the letters anywhere, so "call" inside "call-back" counts too, and so would "recall". If that matters, search for " call " with spaces and add a space to both ends of the text: " "&UPPER(A7)&" ".

=(LEN(A7)-LEN(SUBSTITUTE(UPPER(A7),"CALL","")))/LEN("CALL")

Result: 2

Returns 2. "Call back re: quote, then call accounts" mentions call twice.

Excel 365: TEXTSPLIT

In Excel for Microsoft 365, =COUNTA(TEXTSPLIT(TRIM(A2)," ")) splits the note into one cell per word and counts them. It reads more clearly, and you can pass several delimiters, such as {" ",","}, to also split on commas. It does not handle empty cells on its own, so keep the IF check. The LEN formula above works in every version.

Common mistakes

Line breaks are not seen as word breaks

Words separated by Alt+Enter have no space between them, so they count as one. Replace line breaks with spaces first: use SUBSTITUTE(A2,CHAR(10)," ") in place of A2 in both parts of the formula.

Non-breaking spaces from web pages

TRIM does not remove character 160, and SUBSTITUTE(A2," ","") does not count it as a space. Replace it first with SUBSTITUTE(A2,CHAR(160)," ").

Spaced dashes count as words

"Sent quote - waiting" counts 4 words because the dash sits between spaces. Remove " - " with SUBSTITUTE before counting if that matters for your limit.

FAQ

Is there a word count function in Excel?

No. Excel has no WORDCOUNT function and no word count in the status bar. Use =LEN(TRIM(A2))-LEN(SUBSTITUTE(A2," ",""))+1, or COUNTA with TEXTSPLIT in Excel 365.

How do I count words in a column in Excel?

Use SUMPRODUCT around the word count formula, multiplied by (LEN(TRIM(range))>0) so empty cells count as 0. The example above totals five notes in one cell.

Why does my word count say 1 for an empty cell?

The formula always adds 1 for the last word. Wrap it in IF(LEN(TRIM(A2))=0,0,...) so empty cells return 0.

How do I count how many times a word appears in a cell?

Use =(LEN(A2)-LEN(SUBSTITUTE(UPPER(A2),"WORD","")))/LEN("WORD"). It ignores case, but it also counts the word inside longer words.

Functions used

Related guides

Updated