# 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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

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

1,106,873
Messages
5,513,920
Members
408,977
Latest member
Cattle