CountIf query for words within string

J

JohnH

Hi all,

I am trying to find a formula that will count specific words within a range.
Some of the cells may be part of a text string for example:

count the word "red" within cells containing "red", "red 1", "red 2" etc.
I know this can be done with the formula...=countif(range, "*red*")

The real question is if I can do this by searching for a word within a cell
value? So, if cell "A1" equals "red", count "red", if cell "A1" equals
"blue", count blue.
Thanks in advance.
 
P

Peter T

If I follow simply amend your formula

=countif(range, "*" & A1 & "*")

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top