Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

My sheet looks like this:

1|A      | B
2|amount | source
3|173.00 | bank1
4|173.00 | cc
5|173.00 | cash
6|173.00 | bank2
7|173.00 | cc
8|SUM

This is simplified but what I want to do is Sumif A3:A7 if B3:B7 does not contain cash or cc. Sumif needs to either include or exclude 2 criterion.

My working solution is

=(sumif(B3:B7,"<>cc",A3:A7)-sumif(B3:B7,"cash",A3:A7))

Just wanted to know if anyone knew a way to exclude/include more than one criteria in a straight-forward way?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Try this:

=ArrayFormula(sumproduct($A$3:$A$7,$B$3:$B$7<>"cc",$B$3:$B$7<>"cash"))

This is a way for you to apply two different evaluations of cell contents (cc and cash) to the same range of numbers.

share|improve this answer
    
Yep! Work perfectly. Thanks! –  lazfish Nov 29 '12 at 20:07
1  
This is such a powerful formula. Opens up a whole new world of possibilities... Helped me solve a problem that took me about 1 hour. Thanks! :) –  Leniel Macaferi Jan 10 '13 at 20:48
add comment

This is also a possible solution for this specific question:

=(sumif(B3:B7,"bank*",A3:A7))

but the first answer is more flexible.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.