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
[TABLE="width: 192"]
<tbody>[TR]
[TD="class: xl65, width: 64"]1[/TD]
[TD="class: xl65, width: 64"]whse 1[/TD]
[TD="class: xl65, width: 64"]wte[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]whse 1[/TD]
[TD="class: xl65"]wte[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]whse 1[/TD]
[TD="class: xl65"]wte[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]whse 2[/TD]
[TD="class: xl65"]wte[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]whse 2[/TD]
[TD="class: xl65"]wte[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]whse 4[/TD]
[TD="class: xl65"]wte[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
=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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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