footballdj123
New Member
- Joined
- Apr 5, 2018
- Messages
- 8
Hello,
I have two dates and an amount field, I want to break the revenue into each month. I have a formula
=(IF(AND($B2>=D$1,$A2<=DATE(YEAR(D$1),MONTH(D$1)+1,0)),MIN($B2,DATE(YEAR(D$1),MONTH(D$1)+1,1))-MAX($A2,D$1),0)/($B2-$A2))*$C2
It breaks down the revenue incorrectly across the months. I took the value and look at it daily and it was slightly off. The total amount does match up, just not how its weighted into each month.
Any idea why?
[TABLE="width: 1223"]
<colgroup><col span="2"><col><col span="6"><col span="3"><col span="7"></colgroup><tbody>[TR]
[TD]Start Date[/TD]
[TD]End Date[/TD]
[TD]Amount[/TD]
[TD]4/1/2018[/TD]
[TD]5/1/2018[/TD]
[TD]6/1/2018[/TD]
[TD]7/1/2018[/TD]
[TD]8/1/2018[/TD]
[TD]9/1/2018[/TD]
[TD]10/1/2018[/TD]
[TD]11/1/2018[/TD]
[TD]12/1/2018[/TD]
[TD]1/1/2019[/TD]
[TD]2/1/2019[/TD]
[TD]3/1/2019[/TD]
[TD]4/1/2019[/TD]
[TD]5/1/2019[/TD]
[TD]6/1/2019[/TD]
[TD]7/1/2019[/TD]
[/TR]
[TR]
[TD]5/18/2018[/TD]
[TD]6/15/2018[/TD]
[TD]4250[/TD]
[TD]$0[/TD]
[TD]$2,125[/TD]
[TD]$2,125[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[/TR]
[TR]
[TD]11/19/2018[/TD]
[TD]12/16/2018[/TD]
[TD]0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
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$4,324[/TD]
[TD]$4,185[/TD]
[TD]$4,324[/TD]
[TD]$4,185[/TD]
[TD]$4,324[/TD]
[/TR]
</tbody>[/TABLE]
I have two dates and an amount field, I want to break the revenue into each month. I have a formula
=(IF(AND($B2>=D$1,$A2<=DATE(YEAR(D$1),MONTH(D$1)+1,0)),MIN($B2,DATE(YEAR(D$1),MONTH(D$1)+1,1))-MAX($A2,D$1),0)/($B2-$A2))*$C2
It breaks down the revenue incorrectly across the months. I took the value and look at it daily and it was slightly off. The total amount does match up, just not how its weighted into each month.
Any idea why?
[TABLE="width: 1223"]
<colgroup><col span="2"><col><col span="6"><col span="3"><col span="7"></colgroup><tbody>[TR]
[TD]Start Date[/TD]
[TD]End Date[/TD]
[TD]Amount[/TD]
[TD]4/1/2018[/TD]
[TD]5/1/2018[/TD]
[TD]6/1/2018[/TD]
[TD]7/1/2018[/TD]
[TD]8/1/2018[/TD]
[TD]9/1/2018[/TD]
[TD]10/1/2018[/TD]
[TD]11/1/2018[/TD]
[TD]12/1/2018[/TD]
[TD]1/1/2019[/TD]
[TD]2/1/2019[/TD]
[TD]3/1/2019[/TD]
[TD]4/1/2019[/TD]
[TD]5/1/2019[/TD]
[TD]6/1/2019[/TD]
[TD]7/1/2019[/TD]
[/TR]
[TR]
[TD]5/18/2018[/TD]
[TD]6/15/2018[/TD]
[TD]4250[/TD]
[TD]$0[/TD]
[TD]$2,125[/TD]
[TD]$2,125[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[/TR]
[TR]
[TD]11/19/2018[/TD]
[TD]12/16/2018[/TD]
[TD]0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD]$0[/TD]
[TD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