• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Conditional Sum if

farrusete

Member
Hi,


I need to sum several fields in a column based on conditions from others. This is it:


ColA / Col B / Col C

---------------------

Jan / castle / 10

Feb / house / 6

Mar / flat / 7

...


I'd need to get all sums for items matching (ColA = Jan) AND ((Col B = castle) OR (ColB = flat))


but sumifs sums matching all conditions and doesnt allow me to set AND / OR conditions. Also i must do it for an entire and growing column ($A:$A, $B:$B and $C:$C)


=SUMIFS($C:$C,$A:$A, "Jan",$B:$B, "castle", $B:$B, "flat")


Thank you so much for your help,
 
=SUMIFS(C:C,A:A,"Jan",B:B,"castle")+SUMIFS(C:C,A:A,"Jan",B:B,"flat")


or


=SUMPRODUCT(--(A:A="Jan"),((B:B="castle")+(B:B="flat")),C:C)


or, an array formula:


=SUM(IF((A:A="Jan)*OR(B:B="castle",B:B="flat"),C:C))
 
Back
Top