View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Count Multiple Instances of Text in a Cell

And to avoid having to array enter the formula:
=SUMPRODUCT(LEN(I2:I44)-LEN(SUBSTITUTE(I2:I44,"blue","")))/LEN("blue")

JE McGimpsey wrote:

One way (array-entered: CTRL-SHIFT-ENTER or CMD-RETURN):

=SUM(LEN(I2:I44)-LEN(SUBSTITUTE(I2:I44,"blue","")))/LEN("blue")

In article ,
dave roth wrote:

Good Afternoon:

I need to be able to count multiple instances of the same piece of text in a
given cell, i.e. "blue, blue, red, green." How I currently have this setup
is:

=countif(I2:I44,"*blue*")
=countif(I2:I44,"*green*")
=countif(I2:I44,"*red*")
on separate rows. In the above example these will return 1 blue, 1 green,
and 1 red; I need it to return 2 blues.

Thanks very much, and a good weekend to all.

Dave Roth


--

Dave Peterson