View Single Post
  #5   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Mon, 5 Sep 2005 04:46:01 -0700, "Tommy T"
wrote:

Thanks Ron,

I'd managed to get that far but the trouble is that I need the cell to be
counted if there is "abc" OR "def" within it. It's the OR bit which is
causing me trouble.

Any ideas?

Tom

"Ron Rosenfeld" wrote:

On Mon, 5 Sep 2005 04:01:02 -0700, "Tommy T" <Tommy
wrote:

I have a colomn of alpha-numeric strings and need to count cells which
contain phrase A or phrase B buried within them. This is driving me crazy,
please help!



=COUNTIF(A:A,"*abc*")

or, if your string to search for is in a cell:

=COUNTIF(A:A,"*"&D2&"*")


--ron


=SUM(COUNTIF(A:A,{"*abc*","*def*"}))

will count each cell that has one or the other string. However, it will double
count cells that have both strings: e.g. 12abc34def56 would get counted
twice.

If you don't want double counting, then:

=SUM(COUNTIF(A:A,{"*abc*","*def*"}),-COUNTIF(A:A,"*abc*def*"),-COUNTIF(A:A,"*def*abc*"))




--ron