Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 2 columns in format MM/DD/YYYY
I need to calculate the difference in months between 2 dates.
Ex: 04/25/2018 - 02/11/2016
and so on...
May be use this where 30.4 gives a good approximation for the number of days in a month on average.
=(MakeDate(2018, 4, 25) - MakeDate(2016, 2, 11))/30.4
This gives 26.44
Look at Rob's response here
Something like this
=(Year(MakeDate(2018, 4, 25)) * 12 + Month(MakeDate(2018, 4, 25))) - (Year(MakeDate(2016, 2, 11)) * 12 + Month(MakeDate(2016, 2, 11)))
I'm doing that in backend
This applies on the back end or front end
Isn't there an easier way?
What is so difficult about the above syntax?
Does this take into consideration leap years?
Are we talking about Month difference or Day Difference? How does Day play any role when determining the difference in Month... I am not sure I understand... from the two dates that you provided... what is your expected output?
I want that if it is more than 12 months it should put something after decimal, ie. 12.xyz..
If it's less than 12 as well, it should show in decimals, ex: a difference of 2 months 15 days should show as 2.5 etc.