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).

Calculation engine functionality differences

In Polaris, if you use a value of NaN (Not a Number) for the Number argument, the ADDYEARS function returns a blank value.

In the Classic Engine, a value of NaN used with ADDYEARS is equivalent to 0.

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

Disclaimer

We may update our documentation occasionally, but will only do so in a way that does not negatively affect the features and functionality of the Anaplan service.