Countif function

M

Malyka

Dear Sir,

I like to count a range of column, but I get only field
that <3 and >7. What is wrong in my formular?

Example:
Countif(D2:d450,"<3 and >9")????

Thanks,
Malyka
 
B

Biff

Hi!

Try one of these:

=COUNTIF(D2:D450,"<3")+COUNTIF(D2:D450,">9")

=SUMPRODUCT(--(D2:D450<3)+(D2:D450>9))

Are you sure you have the criteria correct?

<3 = less than 3
 
J

JE McGimpsey

The countif function can take only one condition. If you really mean
less than 3 OR greater than 7 (since a number can't be both), try

=COUNTIF(D2:D450,"<3") + COUNTIF(D2:D450,">7")

If instead you meant numbers greater than 3 and less than 7, try

=COUNTIF(D2:D450,">3") - COUNTIF(D2:D450,">=7")
 
J

JE McGimpsey

note: there's no need to use the double unary minus if you're going to
use the + operator.
 
C

cdb

Not being very good with formulas, what's the point of the -- in the formaula
mentioned??
 
R

RagDyeR

If you're really looking to do what you posted:

<"Countif(D2:d450,"<3 and >9")????">

Count all values *less* then 3 AND *greater* then 9, you could try this
option also:

=SUM(COUNTIF(D2:D450,{"<3",">9"}))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


Dear Sir,

I like to count a range of column, but I get only field
that <3 and >7. What is wrong in my formular?

Example:
Countif(D2:d450,"<3 and >9")????

Thanks,
Malyka
 
Top