gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
I am trying to determine how much of a value goes in each Year based on the dates.
(If my date range was 12/1/2018 and 1/1/2019 and a value of 48, my results should be 24 in 2018 and 24 in 2019)
(If my Date range was 11/1/2018 and 1/1/2019 and my value was 30, my results should be 20 in 2018 and 10 in 2019)
Here is my data:
In Cell A2 I have "48" in B2 I have 4/30/2018 and in C2 I have 5/5/2018 - in D1 I have 2018, E1 2019, F1 2020..
So I am trying to have a formula in D2 through F2 that parses the value of 48 into the years. So in this example the dates are all in 2018 so 48 should be in D2
My Formula: =IFERROR(((DATEDIF(MAX($B2,DATE(D$1,1,1)),MIN($C2,DATE(D$1,12,31)),"ym")+1)*($A2/(((IFERROR((((YEAR($C2)-YEAR($B2))*12+MONTH($C2)-MONTH($B2))),"")))+1))),0)
My formula is only putting 24 in 2018. The Answer should be 48
Anyone see my error???
(If my date range was 12/1/2018 and 1/1/2019 and a value of 48, my results should be 24 in 2018 and 24 in 2019)
(If my Date range was 11/1/2018 and 1/1/2019 and my value was 30, my results should be 20 in 2018 and 10 in 2019)
Here is my data:
In Cell A2 I have "48" in B2 I have 4/30/2018 and in C2 I have 5/5/2018 - in D1 I have 2018, E1 2019, F1 2020..
So I am trying to have a formula in D2 through F2 that parses the value of 48 into the years. So in this example the dates are all in 2018 so 48 should be in D2
My Formula: =IFERROR(((DATEDIF(MAX($B2,DATE(D$1,1,1)),MIN($C2,DATE(D$1,12,31)),"ym")+1)*($A2/(((IFERROR((((YEAR($C2)-YEAR($B2))*12+MONTH($C2)-MONTH($B2))),"")))+1))),0)
My formula is only putting 24 in 2018. The Answer should be 48
Anyone see my error???
Last edited: