Category: Date and Time function
This function adds add_years number of years to date. If add_years is negative, the years are subtracted.
Argument | Type | Description |
---|---|---|
date | Date or Number (date serial) | A expression representing a date. The date to add years to. |
add_years | Number | The number of years to be added to date, or subtracted if negative. |
Return value type: Number (date serial value).
The date argument can take any value or expression that evaluates to a date serial value, with or without a time portion. Examples include:
addyears(#2019-12-12, 2) //Returns 44542 (Equivalent to 2021-Dec-12.)
addyears(43811, 5) //Returns 45683 (Equivalent to 2024-Dec-12.)
addyears(#2019-12-12, -2) //Returns 43081 (Equivalent to 2017-Dec-12; subtract years.)