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

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Does this work for multiple spaces between words?

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

Formulas used

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

Last reviewed: