Sum between two dates

Gusher

Board Regular
Joined
Aug 21, 2011
Messages
207
Office Version
  1. 365
Platform
  1. Windows
In cell A1 I have a date, in cell A2 I have another later date. In column B I have dates and in column C and D I have numbers. I need a function to return the sum of the numbers in cols C and D between the dates specified in cells A1 and A2.

Many thanks
 
Last edited:

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
Works for me.
In what way did it not work for you?
Do you get an error? What error?
Do you get the wrong reslult? What result DO you get?


Unknown
ABCDEF
17/1/20178/15/20174097342
27/31/20176/2/20178741
38/23/20173470
47/26/20178821
56/8/2017611
68/4/20174238
77/29/20172498
87/18/20171684
96/19/20176216
107/29/2017101
Sheet1
Cell Formulas
RangeFormula
F1=SUMPRODUCT((B1:B100>=A1)*(B1:B100<=A2)*C1:D100)
 
Upvote 0
That means either none of the rows are actually between the 2 dates
Or in the rows that ARE between the 2 dates, the values in C and D are blank, or happen to add up to 0.

Most likely cause is your dates aren't really dates, either the ones in A1 & A2, and/or the ones in column B.

Test them with
=ISNUMBER(A1)

Repeat for A2, and your dates in B

Are they true or false?
 
Upvote 0
That means either none of the rows are actually between the 2 dates
Or in the rows that ARE between the 2 dates, the values in C and D are blank, or happen to add up to 0.

Most likely cause is your dates aren't really dates, either the ones in A1 & A2, and/or the ones in column B.

Test them with
=ISNUMBER(A1)

Repeat for A2, and your dates in B

Are they true or false?

Ah, you are so correct, I somehow entered the dates as a string text, works now, many thanks. Out of curiosity, I notice you have repied to over 40,000 messages. Other the thanks you get from grateful people like me, what motivates you to spend so much time solving other peoples problems. or maybe its the same as doing a crossword puzzle, fills the time and exercises the brain?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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