Solved

# need help to make a sumif formula working

Posted on 2011-09-28
264 Views

0
Question by:jjxia2001
• 3
• 2
• 2
• +1

Author Comment

I forgot to mention that it is in Excel spreadsheet.
0

LVL 9

Expert Comment

Try using SUMPRODUCT, like this:

Good luck!
McOz
0

LVL 92

Accepted Solution

Patrick Matthews earned 500 total points
You can't do that.  Try:

This use of SUMPRODUCT() depends on the function's ability to process arrays, and the fact that Excel treats Boolean TRUE and FALSE as 1 and 0, respectively.  The best treatment I have ever seen for this usage of SUMPRODUCT() is at:

http://xldynamic.com/source/xld.SUMPRODUCT.html

In summary:

1) SUMPRODUCT() will process each member of the designated arrays in turn, multiplying the corresponding values in each array.  As the name suggests, the function then takes the sum of the individual products as its return value

2) In this example, at least one of the arrays returns a TRUE or FALSE Boolean value. When this value is multiplied by a numeric value, or if you use the double unary (double minus sign) operator, Excel treats the Boolean value as 1 or 0

Note that in Excel 2007 the new SUMIFS function allows you to specify multiple criteria, and also to use whole column/row references for SUMPRODUCT.
0

LVL 92

Expert Comment

McOz,

In Excel 2003, you cannot use whole column or whole row references in SUMPRODUCT expressions or in array formulae.  Those restrictions were lifted in Excel 2007.

Patrick
0

LVL 9

Expert Comment

Thanks patrick, I didn't realize that restriction - I've been using 2007 and up for a little while now

McOz
0

LVL 1

Expert Comment

Not sure if it's in Excel 2003 but I think what you're looking for is SUMIFS function

SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2,criteria2], â€¦)

e.g.
0

LVL 92

Expert Comment

gordon2011,

SUMIFS debuted in Excel 2007.

Patrick
0

Author Closing Comment

It works! Thanks!
0