# Difference in Months between dates

• Hello,
I want to calculate the difference in months between dates.
In the table what I want as result.
Start End Result
10/02/2014 14/09/2014 7
11/02/2014 14/09/2014 7
12/02/2014 14/09/2014 7
13/02/2014 14/09/2014 7
14/02/2014 14/09/2014 7
15/02/2014 14/09/2014 6
16/02/2014 14/09/2014 6
17/02/2014 14/09/2014 6
18/02/2014 14/09/2014 6
19/02/2014 14/09/2014 6
10/02/2014 14/09/2015 18
20/02/2014 14/09/2015 17
Can this be done with a formula?
thx aisietie

• Re: Difference in Months between dates

Try the DATEDIF() formula if on a worksheet or the DATEDIFF() function if VBA.

• Re: Difference in Months between dates

Problem is that datedif in formula is not available (Part of Analyses toolpack)
And I cannot find the function that makes the differnce in months.

aisietie

• Re: Difference in Months between dates

UDF:
c00: earliest date;
c01: latest date

Code
``````Function M_month(c00, c01)
M_month = DateDiff("m", c00, c01) + (Day(c00) > Day(c01))
End Function``````
• Re: Difference in Months between dates

thx, snb, that is it!

aisietie

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!