I have some cells with text. I need to count the occurrences of a specific word (not a list) from those cells.
Example sheet:https://docs.google.com/spreadsheets/d/1WECDbepLtZNwNfUmjxfKlCbLJgjyUBB72yvWDMzDBB0/edit?usp=sharing
So far I found one way to count it in English by using SUBSTITUTE
to replace all these words with ""
:
=(LEN(B1)-LEN(SUBSTITUTE(UPPER(B1),UPPER(A5),"")))/LEN(A5)
However, I don't know why but it doesn't work in German.
Best Answer
EDIT
I just realized that you have cross-posted on both sites.
I also realized that there is a much simpler case insensitive formula for your needs
OR (if in cell
A7
we have*HeRo*
)If you want just the word
Hero
, remove the asterisks*
around it.It also works for German or any language.
Original answer
In your sheet you mention that the count should be 14.
Considering that, I believe you are looking for a solution to also include words like
heroes
orHero
If you want to include variations of
hero
, likeHero
orHeroes
you can use:If on the other hand want just the word
Hero
or just some cell value you can omit part of the regex "(([H|h]ero).[a-z]\b)|([H|h]ero)" which would now be"([H|h]ero)" or just
A7
turning the cell depending formula toFunctions used:
REGEXREPLACE
ArrayFormula
CONCATENATE
SPLIT
JOIN
COUNTIF