In Excel: use =(LEN(A2)-LEN(SUBSTITUTE(A2,"widget","")))/LEN("widget") to count how often "widget" occurs inside A2, and wrap the same calculation in SUMPRODUCT for a range; =COUNTIF(A2:A10,"*widget*") answers a different question — how many cells contain it.
On this page7
Put the word to count in a cell, for example D1 = widget, so the formula can refer to it.
For one cell enter =(LEN(A2)-LEN(SUBSTITUTE(A2,$D$1,"")))/LEN($D$1).
For a range enter =SUMPRODUCT((LEN(A2:A10)-LEN(SUBSTITUTE(A2:A10,$D$1,"")))/LEN($D$1)).
To ignore case, use LOWER(A2:A10) and LOWER($D$1) inside SUBSTITUTE.
Check one cell by hand: a cell that contains the word twice must return 2.
What this does
COUNTIF counts cells: a cell that contains the word twice still adds 1. Counting occurrences inside the text needs a length difference instead. SUBSTITUTE removes every occurrence of the word, LEN measures how many characters disappeared, and dividing by the length of the word turns that into a number of occurrences. SUBSTITUTE is case-sensitive, so wrap both the text and the word in LOWER to ignore case. The formula counts the letters wherever they occur, so "widget" is also found inside "widgets". The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “count how many times a word appears in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
A2 holds "widget widget", A3 "blue widget" and A4 "widgets". =(LEN(A2)-LEN(SUBSTITUTE(A2,"widget","")))/LEN("widget") returns 2 for A2: the text has 13 characters, 1 remains after removing both words, and 12 ÷ 6 = 2. For the range, =SUMPRODUCT((LEN(A2:A4)-LEN(SUBSTITUTE(A2:A4,"widget","")))/LEN("widget")) returns 4 (2 + 1 + 1), while =COUNTIF(A2:A4,"*widget*") returns 3 because it counts each matching cell once. Keyword tallies, tag counts and repeated codes inside notes are occurrence questions. Counting cells instead silently undercounts every cell that mentions the word more than once. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. For “count how many times a word appears in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Using
COUNTIF, which returns 1 for a cell that contains the word several times. - Forgetting that
SUBSTITUTEis case-sensitive, so "Widget" is missed when you search for "widget". - Dividing by the wrong length — the difference must be divided by the length of the word.
- Expecting whole-word matching: the letters are also counted inside longer words such as "widgets".
Frequently asked questions
How is this different from counting cells that contain a word?
=COUNTIF(A2:A10,"*widget*") counts cells; the LEN/SUBSTITUTE formula counts every occurrence, so a cell with the word twice adds 2.
Can I count a single character the same way?
Yes — =LEN(A2)-LEN(SUBSTITUTE(A2,"a","")) counts the letter a in A2; no division is needed because its length is 1.
Why does the result have decimals?
The removed length is not a multiple of the word length, usually because the divisor refers to different text than SUBSTITUTE. Use the same cell or text in both places.
Other ways people ask this
This is also commonly searched as “counting how many times a word appears in excel” and “excel formula to count how many times a word appears”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “counting how many times a word appears in excel”, “excel formula to count how many times a word appears” all point at the one operation explained on this page, which is why they all lead here.