I have a need to do some calculations on [Budget] value as follows:
- The Budget value if the Total budget for the year up to the end of the month.
- I will need to see what that value is
- for the CURRENT day (YTD)
- For the current Month as MTD
In order to get this, I need something like the following:
([Budget]/[total days through end of month])*[days in year to current day]
([Budget]/[total days through end of month]) will give me the average [budget]/day value
By multiplying this by the number of days in year to the current date, I will get the target budget to the current day.
For example:
Budget up through end of the month March 2016 = $1000
Days in year to end of March 2016 = 91
If current date is March 14, the total days in year to current date = 74
So the match would be: (1000/91)*74 ==> 813.19
Now I will need to build the dates from scratch using only the CurrentDate() value as a base.
I have tried quite a few options to get the function following functions to work am having issues:
Days through end of the month = DaysBetween(ToDate("01/01/"+Year(CurrentDate());"dd/MM/yyyy");ToDate(LastDayOfMonth(CurrentDate())+"/"+Month(CurrentDate())+"/"+Year(CurrentDate());"dd/MM/yyyy"))
and
Days through end of current date = Days through end of current date = DaysBetween(ToDate("01/01/"+Year(CurrentDate());"dd/MM/yyyy");ToDate(DayNumberOfMonth(CurrentDate())+"/"+Month(CurrentDate())+"/"+Year(CurrentDate());"dd/MM/yyyy"))
Essentially this is failing:
=ToDate("01/01/"+Year(CurrentDate());"dd/MM/yyyy")
Am I way off base or can someone help with this?
R