SUMIFS - 2 conditions, 1 column

mediumraresteak

New Member
Joined
Jan 14, 2016
Messages
13
Hi,

I'm trying to sumif one column with two conditions if possible. If I want to pull wte's total for all warehouses, it should be five. But when I put in the second condition to account for "whse 2", I get zero. Is it looking for both conditions in the same cell? How can I separate it to pull one total? Thanks in advance cause I've been trying for a couple of hours to no avail.

Here's an example: =SUMIFS(A:A,C:C,E1,B:B,"whse 1",B:B,"whse 2")

A B C
1whse 1wte
1whse 1wte
1whse 1wte
1whse 2wte
1whse 2wte
1whse 4wte

<tbody>
</tbody>
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
=SUMIFS(A:A,C:C,E1,B:B,"whse 1",B:B,"whse 2")

This is an AND condition
SUM column A if column C equals E1 and column B equals "whse 1" and column B equals "whse 2"

How can a cell in column B be "whse 1" and "whse 2" at the same time?
It can't.

Use
=SUMIFS(A:A,C:C,E1,B:B,"whse 1")+SUMIFS(A:A,C:C,E1,B:B,"whse 2")
 
Upvote 0
=SUMIFS(A:A,C:C,E1,B:B,"whse 1",B:B,"whse 2")

This is an AND condition
SUM column A if column C equals E1 and column B equals "whse 1" and column B equals "whse 2"

How can a cell in column B be "whse 1" and "whse 2" at the same time?
It can't.

Use
=SUMIFS(A:A,C:C,E1,B:B,"whse 1")+SUMIFS(A:A,C:C,E1,B:B,"whse 2")

Well, I feel like a fool. I tried to incorporate the AND formula into the SUMIFS line without a separate formula on top.

Thank you!!
 
Upvote 0
SUMIFS uses AND logic, you can't say column B must be "whse 1" AND "whse 2" - it's either one or the other.

To get just one keep it as such:
=SUMIFS(A:A,C:C,E1,B:B,"whse 1")

This will sum Column A where Column C is equal to E1 AND column B is equal to "whse 1"
 
Upvote 0
Or using :

=SUMPRODUCT(SUMIFS(A:A,C:C,E1,B:B,{"whse 1","whse 2"}))

which is equal to =SUMIFS(A:A,C:C,E1,B:B,"whse 1")+SUMIFS(A:A,C:C,E1,B:B,"whse 2")

Regards
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,822
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top