why doesn't countif function?

D

dindigul

I typed:
=countif(AND(C:C="BSM11",D:D>0,2))
why I keep getting messages like, you have not entered sufficient items or
error in formula?
THanks
 
R

Rick Rothstein \(MVP - VB\)

I typed:
=countif(AND(C:C="BSM11",D:D>0,2))
why I keep getting messages like, you have not entered sufficient
items or error in formula?

COUNTIF is looking for two arguments... AND returns a single value... a
Boolean (either TRUE or FALSE).

Since you have two different conditions to meet, try using two COUNTIF
functions (one for each condition) and add them together.

Rick
 
B

Bernie Deitrick

=SUMPRODUCT((C1:C100="BSM11")*(D1:D100>0))

Not sure why you'rthrowing the 2 in there as well....

HTH,
Bernie
MS Excel MVP
 
H

Harlan Grove

dindigul said:
I typed:
=countif(AND(C:C="BSM11",D:D>0,2))
why I keep getting messages like, you have not entered sufficient
items or error in formula?

Because COUNTIF has specific syntax that you're failing to use. It
takes two and only two mandatory arguments, and the first one must be
a reference to a single-area range in an open workbook.

FWIW, if you're running Excel 2007, you could use

=COUNTIFS(C:C,"=BSM11",D:D,">0.2")
 
Top