View Single Post
  #3   Report Post  
Dave O
 
Posts: n/a
Default

Here's one way, assuming the values to sum are in C1:C5:
=SUMPRODUCT(--(A1:A5=F2),--(B1:B5=G1),C1:C5)

This is effectively an expanded SUMIF formula that allows multiple IF
comparisons. The "--" in the formula are double unary operators that
cause Excel to evaluate the comparisons as a 0 if false and a 1 if
true. For each row, the Sumproduct evaluates the true / false 1/0 and
multiplies by the value in the "to be summed" column. If one or more
of the comparisons is false, the formula multiplies by zero, augmenting
the overall sum by zero since 0 times any number is zero.