Add Days to Date Using Salesforce Formula : Bijay Kumar

Add Days to Date Using Salesforce Formula
by: Bijay Kumar
blow post content copied from  SalesForce FAQs
click here to view original post



**Summary:** The content discusses how to automate the process of calculating follow-up dates for customer support cases in Salesforce, specifically by creating a formula field that adds three days to the case creation date. This process not only streamlines the workflow but can also be applied in various scenarios, such as determining due dates for tasks or payment schedules. **Key Steps to Create the Formula Field:** 1. Navigate to Setup in Salesforce and select the Object Manager. 2. Choose the specific object (e.g., Products) where you want to create the formula field. 3. In the Fields and Relationships section, create a new field and select the Formula type. 4. Define the field label, API name, and set the return type to Date. 5. Use the formula: `DATE(YEAR(Purchase_Date__c), MONTH(Purchase_Date__c), DAY(Purchase_Date__c) + 3)`. 6. Check the syntax, adjust field visibility settings, and save your changes. 7. After creating the field, it will automatically calculate the new date when a product is added. This formula utilizes Salesforce functions like DATE(), YEAR(), MONTH(), and DAY() to add days to a specified date. **Conclusion:** The article explains how to effectively use Salesforce formulas to automate date calculations, promoting efficiency in customer support and task management. **Additional Context:** Using formula fields in Salesforce can greatly enhance productivity and accuracy in various business processes. Automation helps reduce manual errors and ensures that critical follow-up actions are not overlooked. **SEO Hashtags:** #Salesforce #FormulaField #DateCalculation #Automation #CustomerSupport #SalesforceAdmin #CRM #Productivity #BusinessAutomation #SalesforceTips


I was working as a system admin for a company that uses Salesforce to handle customer support cases. Every time a new case is created, the support team must follow up within 3 days after the case is created.

Instead of manually calculating the follow-up date, we can create a formula field in Salesforce that automatically adds 3 days to the case creation date.

In Salesforce, there are many scenarios where we need to add days to a date, such as calculating an expected delivery date, the due date of a task, scheduling follow-up tasks, or determining the payment due date.

In this article, we will learn about how to add days to date using Salesforce Formula. In this, I will create and explain a formula using functions that returns the date after adding days.

Add Days to Date Using Salesforce Formula

Below, I will explain the formula and steps to add days to a given date in Salesforce, so you can automatically calculate the next date with a clear example. For this, we will use the Salesforce Date()Today()Year(), and Month() functions.

  1. Go to the Gear Icon. -> Click on the Setup. -> Select the Object Manager tab. Select the Object on which you want to create the Formula Field to extract the year from the date. Here, I’m going to create a Products Object.
Add Day to Date in Salesforce Lightning using advance formula
  1. In this step, we will use a formula to calculate and display the date after adding days to the given date, and display it on the product object. For that, select the option Formula from the data type and click Next.
add day to date in salesforce lightning using advance formula example
  1. Next, provide the Field Label and API Name for the formula field. Then, since we want to display the next date after adding days to the given date, in the  Formula Return Type, select Date and click on the Next button.
How to add Day to Date in Salesforce
  1. In the formula editor, enter the formula below and click the Next button.
    • Here, we want to use the DATE() function to check the year and month of a given date. We need to select the Advanced Formula.
    • Then select the Function from and click the Insert Selected button to use them. Then, add the date field from the object.
    • Clicking the Insert Field button displays all fields from the product object. Here, we need to add an Purchase_Date__c field to display the next date after adding days in it.
DATE (YEAR (Purchase_Date__c), MONTH (Purchase_Date__c), DAY (Purchase_Date__c) + 3)

Let’s understand the above formula:

  • Here, using the YEAR(), MONTH(), and DAY() functions, we are extracting the year, month, and day of the given date.
  • Then, on the extracted day, we add three more days. For example, if the extracted day is 03, we add 3 days, resulting in 06.
  • Provide this formula and click the Check Syntax button to confirm the formula is correct, and click the Next button.
How to add Day to Date in Salesforce Example
  1. Select the Field Level Security for the formula field, and select the profiles to make the field visible for the profiles. The field will be visible for the profiles selected from the Visible column.
    • After selecting the profiles, click on the Next button.
add days to date in salesforce formula
  1. In this step, we must select the field’s visibility on the object’s page layouts. In this case, we have created the formula field for the reports so we can choose not to display it on the page layouts.
    • Uncheck the checkboxes of the page layouts to prevent the field from displaying on them. After this, click on the Save button.
add days to date in salesforce formula example
  1. We can use the formula field once we’ve created it. Let’s look at an example:
    • Create a new product using the Purchase Date value by opening the Products object and saving it.
    • Next, click on the Details section, and the Payment Due Date field will appear with a date value that has been adjusted by three additional days.
example to add days to date in salesforce formula

In this way, we can create a formula field to add days to a given date in Salesforce, so we can automatically calculate the next date.

Conclsuion

I hope you have an idea about how to add days to a date using Salesforce Formula with the DATE(), MONTH(), and YEAR() functions, so that it can be used in formulas, reports, or automation in Salesforce. In this, I have created and explained a formula using functions that returns the date after adding days.

You may like to read:

The post Add Days to Date Using Salesforce Formula appeared first on SalesForce FAQs.


August 26, 2025 at 05:30PM
Click here for more details...

=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce