Count specific words in a cell in Excel
This article is going to introduce formula to count the number of times a specific word appears in a cell in Excel.
How to count specific words in a cell in Excel?
How to use this formula?
Here is the step-by-step guide to help you apply the formula in Excel.
For example, you want to count number of times the word “tool” appears in cell B5, please do as follows.
Select a blank cell, copy the below formula into it to get the result immediately.
Tips: Instead of directly typing the word in the formula, you can type the word in a certain cell, and then reference this cell in the formula. See the below formula and screenshot:
- 1. Please change the cell B5 and word “tool” to your own needs;
- 2. If the word is not found, it will return 0;
- 3. The formula is case-sensitive;
- 4. If you want to count specific word in a cell and ignore the case, please use the UPPER function inside the SUBSTITUTE as the below formula shown:
How this formula works
- 1. SUBSTITUTE(B5,"tool",""): The SUBSTITUTE function remove the specific word “tool” from the original text cell-B5;
- 2. LEN(SUBSTITUTE(B5,"tool" ,"")): The LEN function here calculates the length of the original text in B5 without the specific word. Here the result is 35;
- 3. (LEN(B5)-LEN(SUBSTITUTE(B5,"tool",""))): The above number (35) is then subtracted from the total length of the original text string (47), and get the result 47-35=12;
- Here the result 12 is the total length of the specific word “tool” in the original text string;
- 4. LEN("tool"): The LEN function here calculates the length for “tool”, and returns the result 4;
- 5. 12/4: Finally, the total length of the “tool” - 12 is divided by per length of the “tool”- 4 and get 3 as the result.