# Sumifs with or statement over multiple columns

1. ## Sumifs with or statement over multiple columns

I'm working on a problem where I'd like to sum the data on column A. I'd like it to sum the value if column B equals "b" OR if the value in column C equals "a". I've attached the example.

I've tried a bunch of ways but I can't figure it out. It's driving me nuts.

Workbook1.xlsx

Thanks!  Register To Reply

2. ## Re: Sumifs with or statement over multiple columns

Maybe this

=SUM(SUMIF(B1:B11,"B",A1:A11),SUMIF(C1:C11,"A",A1:A11))  Register To Reply

3. ## Re: Sumifs with or statement over multiple columns

Do a Sum and Sumif.

And in case that there's a situation Col B = b AND Col C = A there's a logical test... to check if it's true, and if it's true then we take it out of the total.  Register To Reply

4. ## Re: Sumifs with or statement over multiple columns

Is there a way to do this without adding a column?  Register To Reply

5. ## Re: Sumifs with or statement over multiple columns

You mean get rid of the true false column... yeah you can do it this way:

Same formula only the last part is a sumproduct calculation.

Your total will now be exactly how you want it to be... in case we have a situation of both col B has a B value and col C has a A value that amount is excluded from the total.

=SUM(SUMIF(B1:B11,"B",A1:A11),SUMIF(C1:C11,"A",A1:A11))-SUMPRODUCT((B1:B11="b")*(C1:C11="a"),A1:A11)

Hilmy  Register To Reply

There are currently 1 users browsing this thread. (0 members and 1 guests) 