# Sum/Count Multiple Conditions

##### New Member
I am looking for a couple of creative ways to achieve the following in excel:

On a spreadsheet I have a list of numbers that have been identified as the top five defect drivers. Also established are a top five list of typically occurring defects. The end result that I am trying to get to is a stacked bar chart that exhibits the top five part numbers and which of the top five defects affect those part numbers. In other words, I’d like to write a formula that will lookup the part number from a list and then count the defects from the established list of five and return a number. Hope this is making sense. I have attached an excel file (SUM MULTIPLE CONDITIONS.xls) that will hopefully illustrate my goal a little better if needed.

I’d prefer to stay away from VBA as much as possible and stick with formula options.

Thanks!

Last edited:

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

#### hsk

##### Well-known Member
have u tried Pivot ?

Other way is the array formula ....
e.g.
Count on Multiple condition:
Trick is to use SUM formula on range, when used with condition it returns 1 if condition is satisfied else zero.
E.g. SUM(A1="aa") ….. This will return 1 if cell A1 has value aa
When criteria is spanned over multiple columns, we have to use combination of multiplication and additioin according to the condition.
use multiplication for AND condition and addition for OR condition
i.e. if condition is COUNT IF A="aa" AND B="bb" AND C="cc" then,
={SUM((A1:A5="aa")*(B1:B5="bb")*(C1:C5="cc"))} ............ use Shift+Ctrl+Enter for Range Formula

if condition is COUNT IF A=("aa" OR "AA") AND B="bb" AND C="cc" then,
={SUM((A1:A5="aa")*(B1:B5="bb")*(C1:C5="cc")) + SUM((A1:A5="a1")*(B1:B5="bb")*(C1:C5="cc"))} ............ use Shift+Ctrl+Enter for Range Formula

Hope this helps .......

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,523
Messages
5,837,845
Members
430,518
Latest member
smithk901

### 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.

### Which adblocker are you using?

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

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