Countif

K

Khalil handal

Hi,
Cell C12 has this formula: COUNTIF($E12:$AI12,$C$5)
What modifications should be done so as it will count the values equal to C4
(in addition to C5).
Khalil
 
B

Bob Phillips

=SUMPRODUCT(SIGN(($E$12:$AI$12=$C$4)+($E$12:$AI$12=$C$5)))

or if contiguous then

=SUMPRODUCT(--(($E$12:$AI$12=$C$4:$C$5)))

or

=SUMPRODUCT(--ISNUMBER(MATCH($E$12:$AI$12,$C$4:$C$5,0)))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Matt Richardson

Hi,
Cell C12 has this formula: COUNTIF($E12:$AI12,$C$5)
What modifications should be done so as it will count the values equal to C4
(in addition to C5).
Khalil

=COUNTIF($E12:$AI12, OR($C$5, $C$4))

Using the OR function will allow you to count multiple criteria.

HTH,
Matt Richardson
http://teachr.blogspot.com
 
B

Bob Phillips

May I suggest that you actually try your suggestion here, and your other
one.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Matt Richardson

May I suggest that you actually try your suggestion here, and your other
one.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Ignore my response earlier! I've answered two questions this morning
about COUNTIFs and both were wrong. My head's just not screwed on
right today LOL.

Theres a couple of other ways of doing this here:-

http://www.ozgrid.com/Excel/count-if.htm

Regards,
Matt Richardson
http://teachr.blogspot.com
 
K

Khalil Handal

Hi,
thank you very much. It was perfect.

Khalil

Bob Phillips said:
=SUMPRODUCT(SIGN(($E$12:$AI$12=$C$4)+($E$12:$AI$12=$C$5)))

or if contiguous then

=SUMPRODUCT(--(($E$12:$AI$12=$C$4:$C$5)))

or

=SUMPRODUCT(--ISNUMBER(MATCH($E$12:$AI$12,$C$4:$C$5,0)))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)
 
R

RagDyer

And, just in case you might like to use Countif(), try this:

=SUM(COUNTIF($E12:$AI12,N(INDIRECT({"C4","C5"}))))
 
Top