# Sum Based on Dates

#### Deagers

##### New Member
Hi Forum,

I'm New to Excel Programming and have a basic understanding of both macros and formulas.
I'm are after a formula for the following;

 Purchase Date Qty Total Cost Compressor 28/2/2014 1 600 25/8/2014 Battery 7/5/2014 2 80 31/8/2014 Spray Gun 26/8/2014 2 400 Work Boots 27/8/2014 1 150

<tbody>
</tbody>

I would like a formula to give me a sum of D (Total Cost) Based on a period between 2 Dates (The ones in Column E).

=sumifs(D2:D5,B2:B5,if(AND(

This is what i have come up with so far not sure if I'm on the right track or nor and I'm not sure how to finish it.
Any Help Would be greatly appreciated Thanks Guys.

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### Caribeiro77

##### Well-known Member
Try:

=SUMIFS(\$D\$2:\$D\$5,\$B\$2:\$B\$5,">0"&E1,\$B\$2:\$B\$5,"<="&E2)

#### Deagers

##### New Member
Hi Caribeiro77 ,

Thanks alot that worked perfectly

#### Caribeiro77

##### Well-known Member
But please correct the formula i gave you from ">0" to ">="

Replies
2
Views
502
Replies
3
Views
312
Replies
1
Views
254
Replies
1
Views
165
Replies
2
Views
149

1,191,383
Messages
5,986,305
Members
440,017
Latest member
vasanrajeswaran

### 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.

### Which adblocker are you using?

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

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