Category: Date and Time function
This function returns the number of full months between two dates (date1 and date2).
Argument | Type | Description |
---|---|---|
date1 | Date or Number (date serial) | An expression representing a date. The date to calculate the difference from. |
date2 | Date or Number (date serial) | An expression representing a date. The date to calculate the difference to. |
Return value type: Number (Integer).
The result is a non-fractional integer, as an absolute value, so the dates can be entered in either order.
The date1 and date2 arguments can take any value or expression that evaluates to a date serial value. Examples include:
agemonths(#1960-05-10, #2021-08-29) //Returns 735.
agemonths(#2021-08-29, #1960-05-10) //Returns 735. (Dates are in reversed order from above.)
agemonths(#1825-06-15, #2050-06-15) //Returns 2700.