how to countif multiple conditions

camiina

New Member
Joined
May 1, 2011
Messages
2
<table border="0" cellpadding="0" cellspacing="0" height="40" width="162"><colgroup><col style="width:48pt" span="3" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;width:48pt" height="20" width="64">
</td> <td class="xl65" style="border-left:none;width:48pt" width="64">I would like to count the cells which meet all the 3 requirements:
Type=apple
Amount=1 or 2
Condition=good
. Could you tell me how i could do this?
Thanks
</td> <td class="xl66" style="border-left:none;width:48pt" width="64">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none" height="20">
</td> <td class="xl63" style="border-top:none;border-left:none"> <table border="0" cellpadding="0" cellspacing="0" height="241" width="259"><colgroup><col style="width:48pt" span="5" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td class="xl67">Type</td> <td class="xl68" style="border-left:none">Amount</td> <td class="xl69" style="border-left:none">Condition</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">
</td> <td class="xl70" style="border-top:none" align="center">Apple</td> <td class="xl71" style="border-top:none;border-left:none" align="center">1</td> <td class="xl72" style="border-top:none;border-left:none" align="center">Good</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">
</td> <td class="xl73" style="border-top:none" align="center">Orange</td> <td class="xl66" style="border-top:none;border-left:none" align="center">4</td> <td class="xl74" style="border-top:none;border-left:none" align="center">Good</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">
</td> <td class="xl73" style="border-top:none" align="center">Banana</td> <td class="xl66" style="border-top:none;border-left:none" align="center">3</td> <td class="xl74" style="border-top:none;border-left:none" align="center">Bad</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">
</td> <td class="xl73" style="border-top:none" align="center">Apple</td> <td class="xl66" style="border-top:none;border-left:none" align="center">8</td> <td class="xl74" style="border-top:none;border-left:none" align="center">Good</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">
</td> <td class="xl73" style="border-top:none" align="center">Apple</td> <td class="xl66" style="border-top:none;border-left:none" align="center">2</td> <td class="xl74" style="border-top:none;border-left:none" align="center">Good</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl65" style="height:15.0pt" height="20">
</td> <td class="xl73" style="border-top:none" align="center">Grape</td> <td class="xl66" style="border-top:none;border-left:none" align="center">1</td> <td class="xl74" style="border-top:none;border-left:none" align="center">Bad</td> <td>
</td> </tr> <tr style="height:15.75pt" height="21"> <td style="height:15.75pt" height="21">
</td> <td class="xl75" style="border-top:none" align="center">Orange</td> <td class="xl76" style="border-top:none;border-left:none" align="center">1</td> <td class="xl77" style="border-top:none;border-left:none" align="center">Good</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">
</td> <td>
</td> <td>
</td> <td>
</td> <td>
</td> </tr> </tbody></table></td> <td class="xl68" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none" height="20">
</td> <td class="xl63" style="border-top:none;border-left:none">
</td> <td class="xl68" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none" height="20">
</td> <td class="xl63" style="border-top:none;border-left:none">
</td> <td class="xl68" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none" height="20">
</td> <td class="xl63" style="border-top:none;border-left:none">
</td> <td class="xl68" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl67" style="height:15.0pt;border-top:none" height="20">
</td> <td class="xl63" style="border-top:none;border-left:none">
</td> <td class="xl68" style="border-top:none;border-left:none">
</td> </tr> <tr style="height:15.75pt" height="21"> <td class="xl69" style="height:15.75pt;border-top:none" height="21">
</td> <td class="xl70" style="border-top:none;border-left:none">
</td> <td class="xl71" style="border-top:none;border-left:none" align="center">
</td> </tr> </tbody></table>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="font-weight: bold;;">Type</td><td style="font-weight: bold;;">Amount</td><td style="font-weight: bold;;">Condition</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">Apple</td><td style="text-align: center;;">1</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">Orange</td><td style="text-align: center;;">4</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;">Banana</td><td style="text-align: center;;">3</td><td style="text-align: center;;">Bad</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;">Apple</td><td style="text-align: center;;">8</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;;">Apple</td><td style="text-align: center;;">2</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">Grape</td><td style="text-align: center;;">1</td><td style="text-align: center;;">Bad</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;">Orange</td><td style="text-align: center;;">1</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">1</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">C10</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">--(<font color="Red">A2:A8="Apple"</font>)*(<font color="Red">B2:B8=1</font>)*(<font color="Red">C2:C8="Good"</font>)</font>)</td></tr></tbody></table></td></tr></table><br />


<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="font-weight: bold;;">Type</td><td style="font-weight: bold;;">Amount</td><td style="font-weight: bold;;">Condition</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: center;;">Apple</td><td style="text-align: center;;">1</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: center;;">Orange</td><td style="text-align: center;;">4</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: center;;">Banana</td><td style="text-align: center;;">3</td><td style="text-align: center;;">Bad</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: center;;">Apple</td><td style="text-align: center;;">8</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: center;;">Apple</td><td style="text-align: center;;">2</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: center;;">Grape</td><td style="text-align: center;;">1</td><td style="text-align: center;;">Bad</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: center;;">Orange</td><td style="text-align: center;;">1</td><td style="text-align: center;;">Good</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: right;;"></td><td style=";">Amount for 1</td><td style="text-align: right;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style="text-align: right;;"></td><td style=";">Amount for 1 AND 2</td><td style="text-align: right;;">2</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">C10</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">--(<font color="Red">A2:A8="Apple"</font>)*(<font color="Red">B2:B8=1</font>)*(<font color="Red">C2:C8="Good"</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">C11</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">--(<font color="Red">A2:A8="Apple"</font>)*(<font color="Red">B2:B8=1</font>)+(<font color="Red">B2:B8=2</font>)*(<font color="Red">C2:C8="Good"</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 
Last edited:
Upvote 0
Try

=SUMPRODUCT(--(A2:A8="Apple"),--ISNUMBER(MATCH(B2:B8,{1,2},0)),--(C2:C8="Good"))
 
Upvote 0

Forum statistics

Threads
1,224,526
Messages
6,179,322
Members
452,906
Latest member
Belthazar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top