Salesforce Due Date Formula: Calculate Due Dates with Examples : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of Salesforce Due Date Formula Tutorial In this tutorial, a Salesforce Admin explains how to automate the Payment Due Date for invoices. Instead of relying on users to enter the due date manually, a formula field is created to calculate the due date automatically, set for 30 days after the Invoice Date. #### Key Points: 1. **Purpose**: To ensure all invoices have a due date automatically calculated, improving efficiency. 2. **Formula Creation**: - Use the `DATEVALUE` function to convert invoice dates. - The formula can be adjusted based on the specific number of days to add (e.g., 30 days). - Another version of the formula calculates the due date based on specific days of the month. 3. **Steps to Create a Formula Field in Salesforce Lightning**: - Access the Salesforce Setup menu. - Navigate to the Object Manager and select the relevant object (like Product). - Create a New Field, choosing “Formula” as the type. - Define the field and enter your formula in the advanced formula editor. - Set field-level security and add it to the desired page layout. 4. **After Creation**: Once the formula field is set up, it automatically displays the Payment Due Date whenever a new invoice is created. #### Conclusion The tutorial provides a simple method for automating due dates in Salesforce, highlighting the usefulness of formula fields in improving task management. ### Additional Information: Understanding how to create and apply formula fields in Salesforce is crucial for admins, as it automates processes and reduces the chances of human error. By using formulas, businesses can streamline their workflows and enhance productivity. ### Relevant Hashtags for SEO: #Salesforce #SalesforceAdmin #FormulaField #WorkflowAutomation #DueDate #SalesforceLightning #CRM #SalesforceTutorial #InvoiceManagement #AutomatedProcesses #SalesforceFormulas
When I was working as a Salesforce Admin in a company, they wanted to set a Payment Due Date on every Invoice record automatically.
They wanted the Due Date to be 30 days after the Invoice Date. Instead of asking users to enter the due date manually each time, I created a formula field in Salesforce that calculated it automatically.
In this Salesforce tutorial, we will learn the Salesforce Due Date Formula. Additionally, we will go over how to use Salesforce to create the due date formula field.
Salesforce Due Date Formula Field
In Salesforce, to make sure our tasks and projects are completed on time, we use a Due Date. To achieve this, we can create a Due Date formula field that automatically calculates the due date based on the requirement.
To create the due date formula, Salesforce provides various built-in functions that help us set it based on specific criteria. Let’s examine some common uses of the due date formula in Salesforce.
Due Date based on the specified number of days:
In a simple case, we calculate the due date based on the created, started, and payment dates, as well as a specified number of days.
Here is the formula:
DATEVALUE(Created/Started/PaymentDate) + No.of.days
- This formula is used to calculate the due date based on the specific number of days to add.
- Here, we use the DATEVALUE function to convert the Created/Started/PaymentDate if given in date and time data type to a date value.
- Then, the number of days is the API Name that stores the number of days to add to the Created/Started/PaymentDate.
Due Date based on specific days of the month:
In this case, we calculate the due date based on specific days of the month.
Here is the formula:
IF(DAY(Created/Started/PaymentDate) <= 18,
DATE(YEAR(Created/Started/PaymentDate), MONTH(Created/Started/PaymentDate), 18),
DATE(YEAR(Created/Started/PaymentDate), MONTH(Created/Started/PaymentDate) + 1, 1))
+ No.of.Days
- Here, we use the IF function that checks the day of the month when the record was created, started, or the payment date is less than or equal to 18.
- If it is, the formula uses the DATE function to create a new date using YEAR, MONTH, and day 18th of that month.
- If the Created/Started/PaymentDate is after the 18th, the formula uses the DATE function to create a new date by setting the year, month, and day to the next month’s 1st.
- Then, to calculate the due date, add the number of days.
We can use any of the above-defined formulas by creating a custom formula field in Salesforce. Let’s move to the next section and learn to create a formula field on the object where we want to set the due date.
With this, we now know about the Salesforce Due Date Formula. Next, we will proceed to learn how to set the due date in Salesforce Lightning.
Formula to Calculate Due Date in Salesforce Lightning
Here are the steps to define the formula to calculate the due date in Salesforce Lightning.
- Click the Setup icon in the top right corner of the page to access Salesforce Setup.
- Click Object Manager from the menu’s left side.

- Look for the item to which we want to set the due date. In this example, I choose the Product object from the list of objects.

- Choose Fields & Relationships. Next, select New.

- Select “Formula” as the field type. Click Next to proceed.

- After entering a Field Label for the formula, the Field Name will be filled in automatically. Here, I enter the Field Label as the Payment Due Date.
- Select Date as the Formula Return Type. After that, click Next.

- Enter the formula that calculates the due date in the Advanced Formula editor. The formula is given below:
Payment_Date__c +5
- In this formula, we add 5 days to a date value stored in a field called “Payment_Date__c”. It helps us to calculate the due date by adding a number of days to an existing payment date.
- To verify that the formula is valid, click Check Syntax. We can specify how you want to handle the empty field and include the Description and Help Text as alternatives.
- Then, select Next.

- Select the appropriate Field Level Security, and to make it visible to everyone, we select the Visible checkbox.
- Select Next.

- Select the Page Layout Name for which the formula field is to be added. Click Save to save the formula field.

- We can use the formula field once it has been created. Let’s look at an example:
- Create a product with a payment date field by opening the Products item and saving it.
- After that, click on the Details section, and the Payment Due Date field will appear.

As a result, we now know how to use Salesforce Lightning’s advanced formula to set the due date.
Conclusion
With this, we have learned the Salesforce Due Date Formula. Moreover, we have learned the simple procedure for setting the due date in Salesforce Lightning.
You may also like the following Salesforce tutorials:
- Salesforce Date Range Formula
- Salesforce Formula Field to Check Null Values for Dates
- Salesforce Date Formula Business Days
- Salesforce Formula Date Greater Than Today
The post Salesforce Due Date Formula: Calculate Due Dates with Examples appeared first on SalesForce FAQs.
September 23, 2025 at 05:38PM
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.
============================

Post a Comment