Sum data between date range

demelza

New Member
Joined
Jun 29, 2011
Messages
25
Hi

I have 2 Columns -

A B
Date Hours <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
21/02/2011 8<o:p></o:p>
05/03/2011 9<o:p></o:p>
05/03/2011 12.5<o:p></o:p>
07/03/2011 3<o:p></o:p>
10/03/2011 21<o:p></o:p>
14/06/2011 26.75<o:p></o:p>
05/07/2011 1.5<o:p></o:p>
11/07/2011 2<o:p></o:p>
11/07/2011 3<o:p></o:p>
04/08/2011 17

There are thousands of rows of similar data. We work on a weekly finance system, and I need to sum hours burned within a particular week for every week going back a few years. I was thinking I could create column C ‘Start Date’ and column D ‘End Date’ and drag down my weekly dates, then write a formula that I can drag down in column E that translates to:<o:p></o:p>
<o:p> </o:p>
“Sum $B$1:$B$100 IF $A$1:$1$00 is >=C1 and/or <=D1”<o:p></o:p>
<o:p> </o:p>
For example if I had a start date of 05/03/2011 and end date of 11/03/2011, the answer would be ’45.5’.<o:p></o:p>
<o:p> </o:p>
I’ve tried SUMIF’s and SUMPRODUCT’s and DSUM’s and VLOOKUP’s, but I can’t get it to work, I'm obviously going wrong somewhere – I either get ‘0’ or #VALUE errors. Any suggestions or advice would be greatly appreciated.<o:p></o:p>
<o:p> </o:p>
Thanks in advance
<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:place w:st="on">Dee</st1:place>
<st1:place w:st="on"></st1:place>
<st1:place w:st="on">PS. I'm from New Zealand hence the different date format!</st1:place>
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try formula below

=SUMPRODUCT(--($A$2:$A$11>=$C$1),--($A$2:$A$11<=$D$1),--($B$2:$B$11))

Biz
 
Upvote 0
Another alternatively solution is

=SUMPRODUCT(($A$2:$A$11>=VALUE($C$1))*($A$2:$A$11<=VALUE($D$1))*($B$2:$B$11))

Biz
 
Upvote 0
Thanks for getting back to me Biz. I've tried both of the formula's however both times I just get '0'. I've tried committing both formula's with Ctrl Shft Enter and doesn't work either. The 3 date columns are formatted as Dates, and the Data column is General (I tried 'Number' but this didn't work either). Can you think where I am going wrong?

I've attached an HTML of a sample of the data - I've never done this before so hopefully it works.

Thanks again

Dee
b><table cellpadding=
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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