View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_911_] Rick Rothstein \(MVP - VB\)[_911_] is offline
external usenet poster
 
Posts: 1
Default how to count if cell "contains" a word

I guess I am missing your point. The way I read the initial post, the OP was
interested in finding the 4-character sequences without regard to the commas
(I assumed they were list delimiters), so it seemed to me that not factoring
them into the search was the thing to do. Are you suggesting the OP may have
been looking for something else that I am simply not seeing?

Rick


"Harlan Grove" wrote in message
...
"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&","," ","")))