=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)))

Signature
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> 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
Khalil Handal - 29 Jan 2008 17:51 GMT
Hi,
thank you very much. It was perfect.
Khalil
> =SUMPRODUCT(SIGN(($E$12:$AI$12=$C$4)+($E$12:$AI$12=$C$5)))
>
[quoted text clipped - 11 lines]
>> C4 (in addition to C5).
>> Khalil
RagDyer - 29 Jan 2008 23:55 GMT
And, just in case you might like to use Countif(), try this:
=SUM(COUNTIF($E12:$AI12,N(INDIRECT({"C4","C5"}))))

Signature
Regards,
RD
---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
> Hi,
> thank you very much. It was perfect.
[quoted text clipped - 16 lines]
>>> to C4 (in addition to C5).
>>> Khalil
> 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
Bob Phillips - 29 Jan 2008 09:46 GMT
May I suggest that you actually try your suggestion here, and your other
one.

Signature
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
>> Hi,
>> Cell C12 has this formula: COUNTIF($E12:$AI12,$C$5)
[quoted text clipped - 10 lines]
> Matt Richardson
> http://teachr.blogspot.com
Matt Richardson - 29 Jan 2008 11:32 GMT
> May I suggest that you actually try your suggestion here, and your other
> one.
[quoted text clipped - 21 lines]
> > Matt Richardson
> >http://teachr.blogspot.com
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