Multiple Sum If

stevekho

New Member
Joined
May 5, 2011
Messages
29
Hello Guys,

So here is my probem

I have a table with

A | B | C | D

Start Date | End Date | A Number A | location

.
.
.


I have a month range -> July 2011 and August 2011

I want to sum all the values between this range (Column C) for a specific location.


Thanks for your help!

Steve
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
It is not working perfectly :(

Let’s assume I have


1-Oct-11..31-Oct-11..269,575..Loc_A

1-Dec-11..31-Dec-11..1,600..Loc_A

1-Dec-11..29-Feb-12..1,161..Loc_A

1-Dec-11..29-Feb-12..16,281..Loc_A

1-Dec-11..29-Feb-12..27,551..Loc_A

1-Dec-11..29-Feb-12..31,652..Loc_A

1-Dec-11..29-Feb-12..164,544..Loc_A

1-Jan-12..29-Feb-12..8,440..Loc_A

1-Jan-12..29-Feb-12..10,854


And my start date is Jan 1st 2012 (Cells AE) and End Date is Feb 1st 2012 (Cells AF) (Not Included), it doesn’t return the right number.

I used

=
SUMIFS($E$16:$E$200,$C$16:$C$200,">="&AE16,$C$16:$C$200,"<"&AF16,$F$16:$F$200,$Y$39)+
SUMIFS($E$16:$E$200,$C$16:$C$200,"<"&AE16,$D$16:$D$200,">="&(AF16-1),K$16:K$200,$Y$39)

It should consider all of the one between December and February but it is not

Thanks for your help

Steve
 
Upvote 0
It is not working perfectly :(

Let’s assume I have


1-Oct-11..31-Oct-11..269,575..Loc_A

1-Dec-11..31-Dec-11..1,600..Loc_A

1-Dec-11..29-Feb-12..1,161..Loc_A

1-Dec-11..29-Feb-12..16,281..Loc_A

1-Dec-11..29-Feb-12..27,551..Loc_A

1-Dec-11..29-Feb-12..31,652..Loc_A

1-Dec-11..29-Feb-12..164,544..Loc_A

1-Jan-12..29-Feb-12..8,440..Loc_A

1-Jan-12..29-Feb-12..10,854


And my start date is Jan 1st 2012 (Cells AE) and End Date is Feb 1st 2012 (Cells AF) (Not Included), it doesn’t return the right number.

I used

=
SUMIFS($E$16:$E$200,$C$16:$C$200,">="&AE16,$C$16:$C$200,"<"&AF16,$F$16:$F$200,$Y$39)+
SUMIFS($E$16:$E$200,$C$16:$C$200,"<"&AE16,$D$16:$D$200,">="&(AF16-1),K$16:K$200,$Y$39)

It should consider all of the one between December and February but it is not

Thanks for your help

Steve
Here is your sample data:

Book1
ABCDEF
210/1/201110/31/2011269,575Loc_A1/1/20122/1/2012
312/1/201112/31/20111,600Loc_A__
412/1/20112/29/20121,161Loc_A__
512/1/20112/29/201216,281Loc_A__
612/1/20112/29/201227,551Loc_A__
712/1/20112/29/201231,652Loc_A__
812/1/20112/29/2012164,544Loc_A__
91/1/20122/29/20128,440Loc_A__
101/1/20122/29/201210,854___
Sheet1

Let's assume you want the sum for Loc_A.

What result do you expect?

Based on the date criteria in E2:F2 there are NO dates in columns A and B that fall within this date range so the sum will be 0.

:confused:
 
Upvote 0
Whoaaa thanks guys :) it helps a lot!

Now if I just want to now the sum betwenn 2 date range?

Like betweek July 1st 09 and July 15th 09, is there a way??

Thanks 10000 Times
Hi stevekho,

An adaptation of array formula given post #3, hoping work for you:
Excel Workbook
ABCDE
1Start DateEnd DateA Number AlocationResult
205/may/201106/may/20114Loc_A3
320/jun/201102/jul/20115Loc_B
401/jul/201108/jul/20111Loc_B
505/jul/201112/jul/20113Loc_C
613/jul/201115/jul/20112Loc_B
714/jul/201116/jul/20116Loc_B
815/jul/201103/ago/20113Loc_D
...
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}. Note: Do not try and enter these manually yourself

Regards.
 
Last edited:
Upvote 0
Not working :(

At T Valko,

within Jan 1st 2012 and Feb 1 2012 (Not Included), we have these values:

1-Dec-11..29-Feb-12..1,161..Loc_A

1-Dec-11..29-Feb-12..16,281..Loc_A

1-Dec-11..29-Feb-12..27,551..Loc_A

1-Dec-11..29-Feb-12..31,652..Loc_A

1-Dec-11..29-Feb-12..164,544..Loc_A

1-Jan-12..29-Feb-12..8,440..Loc_A

1-Jan-12..29-Feb-12..10,854

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

For Instance, when I write:

1-Dec-11..29-Feb-12..1,161..Loc_A

It means that from December 1st to the end of Feb 2012
, I will have on a daily basis, a delivery of 1161. ( During 3 Months)

So When I want to know the deliveries between Jan and Feb, I want to know all the one what will actually deliver something in that range.. Hope it is amking sense :(
 
Upvote 0
Well let’s assume I want the sum between July 1st 2011 and Aug 15th 2011.

The Column A contains the start of my contract, the column B contains the end date of that contract. From the start date to the end date, I will get a delivery on a daily basis.

Hence for instance from April 1st to October 31st 2011, I will get a delivery of 47,748 potatoes on a daily basis.

Hence within the range [ July 1st , Aug 15th 2011], I will go through the range April 1st to October 31st 2011 which contains the range [ July 1st , Aug 15th 2011]. Hence from July 1st to Aug 15th 2011, I will get a 47,748 delivery.

This is basically the logic, If I have several range that contains my input range, I need to consider them for the Sum.

Hope it is clear.

Steve
 
Upvote 0
Not working :(

At T Valko,

within Jan 1st 2012 and Feb 1 2012 (Not Included), we have these values:

1-Dec-11..29-Feb-12..1,161..Loc_A

1-Dec-11..29-Feb-12..16,281..Loc_A

1-Dec-11..29-Feb-12..27,551..Loc_A

1-Dec-11..29-Feb-12..31,652..Loc_A

1-Dec-11..29-Feb-12..164,544..Loc_A

1-Jan-12..29-Feb-12..8,440..Loc_A

1-Jan-12..29-Feb-12..10,854

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

For Instance, when I write:

1-Dec-11..29-Feb-12..1,161..Loc_A

It means that from December 1st to the end of Feb 2012
, I will have on a daily basis, a delivery of 1161. ( During 3 Months)

So When I want to know the deliveries between Jan and Feb, I want to know all the one what will actually deliver something in that range.. Hope it is amking sense :(
Ok, I think I understand now.

Instead of defining the date range as 1/1/2012 and 2/1/2012 why don't you define the actual range that you're interested in: 1/1/2012 and 1/31/2012.

Try this:

=SUMIFS(C2:C10,A2:A10,"<="&E2,B2:B10,">="&F2,D2:D10,"Loc_A")
 
Upvote 0
Guys it is working now!

Thanks a lot, the formula I posted initially was right but I didnt see that at the end of my table (Row 200), I also had some Loc_A...

Thanks a lot for your time and patience guys. I do really appreciate.

Have a nice Summer!
 
Upvote 0

Forum statistics

Threads
1,224,617
Messages
6,179,914
Members
452,949
Latest member
beartooth91

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