Announcements
You can succeed best and quickest by helping others to succeed. Join the conversation.
cancel
Showing results for
Did you mean:
Creator III

## Calculate difference in months between two dates

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...

1 Solution

Accepted Solutions
MVP

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

10 Replies
MVP
MVP

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)))

Creator III
Author

I'm doing that in backend

MVP

This applies on the back end or front end

Creator III
Author

Isn't there an easier way?

MVP

What is so difficult about the above syntax?

Creator III
Author

Does this take into consideration leap years?

MVP

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?

Creator III
Author

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.

Community Browser