Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to show a date based on a selected month. If "Oct 2015" is selected, I want to return the value 30/11/2014.
I have created the below formula, but it doesn't work when I add a "+1" to the month line. Any thought?
=MakeDate(
Year(Calendar.MonthName)-1,
Month(Calendar.MonthName),
Day(MonthEnd(Calendar.MonthName)))
Try this:
=MakeDate(
Year(Calendar.MonthName)-1,
Month(AddMonths(Calendar.MonthName, 1)),
Day(MonthEnd(AddMonths(Calendar.MonthName, 1))))
I think the issue is that Nov only has 30 days and the previous expression was calculating the end of day for Oct which is 31 and expression fails
Try this:
=MakeDate(
Year(Calendar.MonthName)-1,
Month(AddMonths(Calendar.MonthName, 1)),
Day(MonthEnd(AddMonths(Calendar.MonthName, 1))))
So I now have the below, but this simply returns "-"
=MakeDate(
Year(Calendar.MonthName)-1,
Month(AddMonths(Calendar.MonthName,1)),
Day(MonthEnd(Calendar.MonthName)))
Try this:
=MakeDate(
Year(Calendar.MonthName)-1,
Month(AddMonths(Calendar.MonthName, 1)),
Day(MonthEnd(AddMonths(Calendar.MonthName, 1))))
I think the issue is that Nov only has 30 days and the previous expression was calculating the end of day for Oct which is 31 and expression fails