FormulaCraft

How to count words in a cell in Excel and Google Sheets

Excel & Google Sheets
=LEN(TRIM(A2))-LEN(SUBSTITUTE(A2," ",""))+1

Verified example

Computed by a real spreadsheet engine on the sample data below.

Phrase
the quick brown fox

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

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1LEN(TRIM(A2)) is the length with extra spaces removed.
  2. 2LEN(SUBSTITUTE(A2," ","")) is the length with all spaces stripped.
  3. 3The difference is the number of spaces; add 1 for the word count.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Does this work for multiple spaces between words?

Yes — TRIM collapses repeated spaces to single spaces before counting.

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: