1. Calculation functions
  2. All Functions
  3. Time and Date Functions
  4. ADDYEARS

The ADDYEARS function adds a number of years to a date.

For example, you can use the ADDYEARS function to show a customer's contract end date.

Syntax

ADDYEARS(Date, number)

Arguments

ArgumentData typeDescription
DateDateThe date to add years to.
NumberNumberThe number of years to add to the date.

The ADDYEARS function returns a date result.

Additional information

If you want to subtract the number of years from a date in a formula, you can use negative numbers. For example, ADDYEARS(Amended contract date, -2).

Excel equivalent function

EDATE

Related Anaplan functions

ADDMONTHS

Examples

In this example, a Contract Details module has line items on rows, and the Customers list on columns. Both line items have a date format.

The formula returns the date two years after the customer's contract start date.


Customer ACustomer B
Contract start date01/01/202101/06/2021

Contract end date

ADDYEARS(Contract start date, 2)

01/01/202301/06/2023

If you want to add years and days to a date, you can use additional numbers in your formula. In this example, the formula returns the date one year and seven days after the contract start date.


Customer ACustomer B
Contract start date01/01/202101/06/2021

Contract end date

ADDYEARS(Contract start date, 1) + 7

08/01/202208/06/2022