ElapsedMonths returns elapsed time in complete years and months between a beginning date and an ending date.
The calculation
is performed as follows:
Function ElapsedMonths(Date1, Date2) m1 = Month(Date1): d1 = Day(Date1): y1 = Year(Date1) m2 = Month(Date2): d2 = Day(Date2): y2 = Year(Date2) LastDay = DaysInMonth(m2, y2) ElapsedMonths = (y2 - y1) + (m2 - m1) / 12 If (d2 < d1) And (d2 < LastDay) Then ElapsedMonths = ElapsedMonths – (1 / 12) End Function |
Syntax
ElapsedMonths (Date1,
Date2)
Parameter Name |
Description |
Date1 |
The
earlier date. |
Date2 |
The
later date. |
Related Topics