FormulaCraft

How to count how many times a word appears in a cell in Excel and Google Sheets

Excel & Google Sheets
=(LEN(A2) - LEN(SUBSTITUTE(A2, "the", ""))) / LEN("the")

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. 1SUBSTITUTE removes every "the" from the text.
  2. 2Subtracting the new length from the original gives the total characters removed.
  3. 3Dividing by the length of "the" gives the number of occurrences.

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 count partial matches?

Yes — "the" would also match inside "there". Add spaces around the word, or use a more specific term, to count whole words only.

Formulas used

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

Last reviewed: