View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default how to count if cell "contains" a word

"Rick Rothstein \(MVP - VB\)" wrote...
That's true; but, of course, this is a problem for most search type
functions (FIND, SEARCH, InStr in VB, etc.). Of course, permitting
these items anywhere in the text seemed to be indicated given this
example that the OP included...

3 ,abcd, abcf, abcg,

....

Note the commas.

*YOUR* formula fails to make use of the commas.

Try the array formula

=COUNT(FIND(",abcd,",SUBSTITUTE(","&A1:A5&","," ",""))
+FIND(",abcf,",SUBSTITUTE(","&A1:A5&","," ","")))