CountIF

B

Bob Phillips

=SUMPRODUCT(--(D2:D23>9),--(D2:D23<20))


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
C

cteacher

I am trying to count a range of cells with multiple conditions. I know
CountIf will not allow two conditions; however, I am trying to count cells
with numbers in cells D2:d23 >9 and <20.

Please help!
 
R

Rob J

Try this...

=countif(d2:d23,and(>9,<20))

Using AND should check that both conditions are true before returning true
to the countif.
 
D

Dave F

=COUNTIF(D2:D23<"9")-COUNTIF(D2:D23<"20")

Subtract the count of numbers less than 9 from the count of numbers less
than 20, and you will have the count of all numbers from 9 to 19, inclusive.

Dave
 
C

cteacher

Hi Rob,

This only gives me a zero. Looking at my range of numbers, it should be 1.
 
C

cteacher

Here are the range of numbersL

69
13
100
81
63
81
75
25
69
69
81
75
63
81
81
44
69
81
94
69
75
81
 
D

Dave F

It gave you -1 because I reversed it.

It should be:

=COUNTIF(D2:D23<"20")-COUNTIF(D2:D23<"9")

Sorry about that.

Dave
 
D

David Biddulph

Dave,

I guess you intended to say
=COUNTIF(D2:D23,"<20")-COUNTIF(D2:D23,"<9")

Note the commas between the arguments for the COUNTIF function, and also the
positioning of the double quotes.
 
S

Sandy Mann

Dave F said:
=COUNTIF(D2:D23<"20")-COUNTIF(D2:D23<"9")

Dave,

Does that construction work for you?

I need to change it to:

=COUNTIF(D2:D23,"<20")-COUNTIF(D2:D23,"<9")

in XL97 Professional to get it to work.

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top