Thread: countif
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default countif

=countif(b1:b5, "*" & a1 & "*")

JRD wrote:

Is there a way of counting the number of cells in a column that contain at
least in part a certain string variable that is contained in another cell
using for instance the countif function

e.g.
A B
1 CABG CABG
2 CABG
3 PCI
4 CABG, PCI
5 PCI

=countif(b1:b5, a1)

I want the answer to be 3, but the above function gives an answer of 2
because cell B4 does not fit exactly. However, I do want to use a1 as the
criteria and not just put "*CABG*" instead


--

Dave Peterson