Counting Cells that contain Specific text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings Excel Masters!

I am trying to count a range of cells that contain certain text characters. The characters will not always be in order, there will be times when those characters are alone in the cell and other times when there is additional text. I tried using the COUNTIF function which works when the characters are alone in the cell, but not when there are other characters. Details below:

=COUNTIF(H2:DH2,B21) So B21 contains SGT, the range may have instances like SGT, SGT TT, TM SGT, etc. Its counting SGT alone but not the other instances. I can't seem to figure it out. Any help is greatly appreciated. Thank you.
 
=COUNTIF(H2:DH2,"*"&B21&"*")

HTH
Jason
Atlanta, GA

-----Original Message-----
Greetings Excel Masters!

I am trying to count a range of cells that contain
certain text characters. The characters will not always
be in order, there will be times when those characters
are alone in the cell and other times when there is
additional text. I tried using the COUNTIF function
which works when the characters are alone in the cell,
but not when there are other characters. Details below:
=COUNTIF(H2:DH2,B21) So B21 contains SGT, the range
may have instances like SGT, SGT TT, TM SGT, etc. Its
counting SGT alone but not the other instances. I can't
seem to figure it out. Any help is greatly appreciated.
Thank you.
 
Back
Top