Fun with COUNT and AND functions.

J

Johosh

Okay... i'm trying to count the amount of times 2 different values appear in
a row.
ie basically, how many rows the number '4' occurs in column 'b' and
'toronto' occurs is column 'c'.
it can only count rows where both cases are true.
I just can't make it work.

lil help?
 
R

Ron Coderre

Darn...I typed B's instead of 4's:

Here're the corrected versions:

=SUMPRODUCT((B10:B100=4)*(C10:C100="toronto"))
or
=SUMPRODUCT(--(B10:B100=4),--(C10:C100="toronto"))

Again...Adjust range references to suit your situation
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)
 
P

PCLIVE

Try this:

=SUMPRODUCT(--(B1:B20=4),--(C1:C20="toronto"))

Adjust your range as needed.

HTH,
Paul
 
J

Johosh

Is there any way to add wildcard values to this formula? it may be maditory
for what i need to do.
 
R

Ron Coderre

Perhaps this:
=SUMPRODUCT((B10:B100=4)*ISNUMBER(SEARCH("toronto",C10:C100)))

If you're referencing another sheet...try this version:
=SUMPRODUCT(('Sheet 01'!B10:B100=4)*ISNUMBER(SEARCH("toronto",'Sheet
01'!C10:C100)))

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)
 
J

Johosh

That is EXACTLY what i need!

Thanks a lot!

Ron Coderre said:
Perhaps this:
=SUMPRODUCT((B10:B100=4)*ISNUMBER(SEARCH("toronto",C10:C100)))

If you're referencing another sheet...try this version:
=SUMPRODUCT(('Sheet 01'!B10:B100=4)*ISNUMBER(SEARCH("toronto",'Sheet
01'!C10:C100)))

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)
 
R

Ron Coderre

I'm glad I could help!....thanks for letting me know.

***********
Regards,
Ron

XL2003, WinXP
 
Top