Sumif on date range, for data spread evenly in another date range

markollington

New Member
Joined
Nov 27, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
So I have date in the format

ValueStart DateEnd Date
4014/10/2005/11/20
5001/10/2031/10/20

Assuming the value can be spread evenly over days, I want a sumif function that tells gives the following output (ie for Oct, 17 days of the 22 days of 40, PLUS 31 days of the 31 days of 50 = (17/22)*40 + 50 = 80.1

Start date01/10/2001/11/20
End date31/10/2030/11/20
Sum819

Any help appreciated!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the Forum!

Perhaps like this (assuming you count both start and end dates) ...

ABC
1MyValuesStart DateEnd Date
24014 Oct 20205 Nov 2020
3501 Oct 202031 Oct 2020
4
5Start date1 Sep 20201 Nov 2020
6End date31 Oct 202030 Nov 2020
7Sum81.308.70
8
9Check:81.308.70
Sheet1
Cell Formulas
RangeFormula
B7:C7B7=SUM((B5<=EndDate)*(B6>=StartDate)*(IF(B6<EndDate,B6,EndDate)-IF(B5>StartDate,B5,StartDate)+1)/(EndDate-StartDate+1)*MyValues)
B9B9=18/23*40+31/31*50
C9C9=5/23*40
Named Ranges
NameRefers ToCells
EndDate=Sheet1!$C$2:$C$3B7:C7
MyValues=Sheet1!$A$2:$A$3B7:C7
StartDate=Sheet1!$B$2:$B$3B7:C7
 
Upvote 0
Solution

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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