In this Salesforce Tutorial, we will learn the formula to Add Year to Date in Salesforce. Moreover, we will go through the steps using which we can Add the Year to Date Field in Salesforce Lightning and Salesforce Classic.
In Salesforce, there are many scenarios where we need to Add Year to Date in Salesforce, such as Sales Forecasting, Contract Management, Project Planning, Product Expiry, License Warranty, etc.
And, In all these situations, we need to Add Year to Date in Salesforce. So, If you want to explore How to Add Year to Date in Salesforce Lightning and Classic Edition, you have come to the right place.
The following are the topics that we will cover in this Salesforce Tutorial:
- Salesforce Date Field
- Salesforce Day Function
- Salesforce Month Function
- Salesforce Year Function
- Salesforce Date Function
- How to add Year to Date in Salesforce
- Add Year to Date using Advance Formula in Salesforce Lightning
- Add Year to Date using Advance Formula in Salesforce Classic
Salesforce Date Field
In Salesforce, the Data Type is used to represent which type of data we can store in the field of an object. And Date is one of the standard data types in Salesforce.
It is used to store and manipulate the date of the record in a field of the object. And to store data in the Date Field, we use the standard date format.
The Date Field Format is as given below:
YYYY-MM-DD
Here, YYYY represents the year in 4 digits, MM represents the month in 2 digits, and DD represents the day in 2 digits.
For example, the Date Field is “2023-03-29” which represents March 29th, 2023.
With, this we have learned about Salesforce Date Field. Now, we will move ahead and learn about the different Date Field functions in Salesforce.
Salesforce Date Field Functions
In Salesforce, we have several functions related to Date Field. These functions are used to extract the Date, Month, Year, and Day from the Date.
Let’s discuss each of these functions briefly.
Salesforce Day Function
In Salesforce, the DAY() function is used to extract and return the day of the month from a date.
The syntax of the DAY function is as below:
DAY(date)
Salesforce Month Function
In Salesforce, the MONTH() function is used to extract and return the month of the year from a date.
The syntax of the MONTH function is as below:
MONTH(date)
Salesforce Year Function
In Salesforce, the YEAR() function is used to extract and return the year from a date.
The syntax of the YEAR function is as below:
YEAR(date)
Salesforce Date Function
In Salesforce, the DATE() function is used to create date value with year, month, and day values.
The syntax of the DATE function is as below:
DATE(year, month, date)
With, this we have learned about different functions related to Salesforce Date Field. Now, we will move further and see the formula Add Year to Date in Salesforce.
Read Add Hour to DateTime Field in Salesforce
How to add Year to Date in Salesforce
In Salesforce, to add a specific number of Year in a Date value, we use the Salesforce Date() and Year() functions together.
Here is the syntax to add Year to Date in Salesforce:
DATE(YEAR(date_field) + No.of years,MONTH(date_field),DAY(date_field))
In this code, The API name of the date field we want to add a year to should be entered for the Date Field. And this formula returns a new date that is one or more years after the original.
Let’s understand it in detail with the help of an example:
Let’s say we want to create a formula to determine the Expiry of the Product by adding 1 year to the Manufacturing Date. And, Here is the formula for this:
DATE(YEAR(Mfg_Date__c)+1, MONTH(Mfg_Date__c), DAY(Mfg_Date__c))
Moreover in this article, we will also learn to determine whether a year is a leap year and create a formula to add the year to date for this also.
With, this we have learned the formula to add year to date in salesforce. Now, we will move further and see How to Add Year to Date in Salesforce Lightning.
Add Year to Date using Advance Formula in Salesforce Lightning
Here, are the steps to Add Year to Date using the Advance Formula in Salesforce Lightning.
Step 1: Log in to your Salesforce account and navigate to Setup.
Step 2: On the left-hand menu, click on Object Manager.

Step 3: Click on the object for which we want to add a year to date. Here, I select the Product object from the list of objects.

Step 4: In the left-hand menu of the object page, click on Field & Relationship.
Step 5: Click on the New button to create a new Field and Relationship.

Step 6: Select the field type. Here, I select the Formula as the field type.
Step 7: Click Next, to continue.

Step 8: Enter a Field Label for the new field, and the Field Name will be automatically populated. Here, I enter Field Label as Product Mfg.
Step 9: Select Date as the Formula Return Type, and click Next.

Step 10: In the Advance Formula editor, enter the formula to Add Year to Date. Here, is the formula copy and paste it:
IF(
MONTH(Product_Mfg__c)=2 && DAY(Product_Mfg__c)=29,
DATE(YEAR(Product_Mfg__c)+1, 2, 28),
DATE(YEAR(Product_Mfg__c)+1, MONTH(Product_Mfg__c), DAY(Product_Mfg__c))
)
- Here, we first check whether the Product Mfg is February with respect to the year given. If it is, it will add one year to the date and returns February 28 of the particular year.
- Otherwise, add one year to the Product Mfg date year to exactly calculate the date with 1 year of addition.
Note: Replace the Product_Mfg__c field with the API name of the date field that you want to modify.
Step 11: To make sure the formula is valid, click Check Syntax.
Step 12: Optionally, we can add the Description, Help Text and specify how you want to handle the blank field.
Step 13: Click Next, if the syntax is correct.

Step 14: Choose the suitable field-level security. Here, I checked the Visible checkbox to make it visible to all.
Step 15: Click Next.

Step 16: Choose the Page Layout option and click Save.

Once the formula is created, open the Products object and create a new product with the Product Mfg value and save it. After that, click on the Details section and here we will get the Product Expiry field with the date value having one more year.

With this, we have learned to add the Year to Date field using the advance formula in Salesforce Lightning. Next, we will see how we can add the Year to Date field using the advance formula in Salesforce Classic.
Add Year to Date using Advance Formula in Salesforce Classic
Here, are the steps to Add Year to Date using the Advance Formula in Salesforce Classic.
Step 1: Log in to your Salesforce Classic account. Click on Avtar and then select Switch to Salesforce Classic.

Step 2: Go to the Setup menu in Salesforce Classic.

Step 3: Click on the Build section.
Step 4: Then, under Customize section select the Object for which we want to add Year to the Date field. Here, I select the Campaign object from the list of objects.
Step 5: Click on the dropdown arrow and select Fields.

Step 6: Scroll down to the page and click on the New button under Custom Fields & Relationships.

Step 7: Select the field type. Here, I select the Formula as the field type.
Step 8: Click Next, to continue.

Step 9: Enter a Field Label for the new field, and the Field Name will be automatically populated.
Step 10: Select Date as the Formula Return Type, and click Next.

Step 11: Enter the Add Year to Date formula into the Advance Formula editor. This is the formula to copy and paste:
IF(
MONTH(Campaign_Start_Date__c)=2 && DAY(Campaign_Start_Date__c)=29,
DATE(YEAR(Campaign_Start_Date__c)+1, 2, 28),
DATE(YEAR(Campaign_Start_Date__c)+1, MONTH(Campaign_Start_Date__c), DAY(Campaign_Start_Date__c))
)
- Here, we first determine whether the given year is February corresponds to the Campaign_Start_Date__c. If so, it will return February 28 of that specific year and add one year to the date.
- In every other case, we must add a year to the Campaign Start Date year in order to determine the date exactly with a 2-year addition.
Note: Replace the Campaign_Start_Date__c field with the API name of the date field that you want to modify.
Step 12: Click Check Syntax to confirm that the formula is correct.
Step 13: Optionally, we can specify how to handle the blank field and provide a description and help text.
Step 14: If the syntax is right, click Next.

Step 15: Choose the appropriate field-level security. To make it visible to all, I selected the Visible checkbox here.
Step 16: Click Next.

Step 17: Click Save after selecting the Page Layout option.

Open the Campaigns object when the formula has been created, add a new campaign with the Campaign Created value, and then save it. After that, click the Details button to access the Upcoming Campaign Date, where the date value has been extended by one year.

From the above screenshot, we have observed that if the start date is 29 Feb of leap year and if we add one year to the date and it will be evaluated as of 28 Feb of next year.
As a result, we now know how to use Salesforce Classic’s advanced formula to add the Year to Date.
You may also like:
- How to add 1 month to Date in Salesforce
- How to add Formula Field in Salesforce Report
- Add Days to Date in Salesforce Formula
- How to add Quick Text in Salesforce
Conclusion
In conclusion, we have learned about Salesforce Date Fied. In addition, we have also explored the Salesforce DATE, DAY, MONTH, and YEAR functions which are used to return the Date field.
Moreover, we have learned that both Salesforce Classic and Salesforce Lightning provide a simple procedure to Add the Year to Date Field.
In addition to this, the following are the topics that we have discussed:
- Salesforce Date Filed
- Salesforce Day Function
- Salesforce Month Function
- Salesforce Year Function
- Salesforce Date Function
- How to add Year to Date in Salesforce
- Add Year to Date using Advance Formula in Salesforce Lightning
- Add Year to Date using Advance Formula in Salesforce Classic
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.