In this Salesforce tutorial, I will explain how to create a formula if the date is less than today in Salesforce.
Salesforce Formula If Date is Less Than Today
You can create a formula in Salesforce to check if the date is less than today in Salesforce. To do so, use the comparison operators Less Than (<) or Less Than or Equal to (<=) to compare the value of the set date with the today field.
Below is the formula to check if the date is less than today.
DateField < TODAY()
#OR
DateField <= TODAY()Formula for Date Less Than Today in Salesforce
Below are the steps to define a formula date less than today’s date in Salesforce.
1. Move to the Setup, click on the Object Manager, search for the Object whose record date you want to check, and click on it. For example, choose the Contract object.

2. Choose the Fields & Relationships option and then click on the New option.

3. After that, click on the Formula as the field type and then click Next to proceed.

4. Enter the Field Label for the formula; the Field Name will be filled in automatically. Here, I enter Field Label as Validation. Then select Text as the Formula Return Type. After that, click Next.

5. Enter the date less than today’s date formula in the Advance Formula editor. Here is the formula:
IF( EndDate < TODAY(), "Contract time period is over. Please renew it.", "Contract is valid for " & TEXT( EndDate - TODAY()) & " days.")- The IF function determines whether the contract end date, called EndDate, is less than the current day, called TODAY. If so, the text Contract time period is over. Please renew it is returned.
- Otherwise, it returns the text Contract is valid for X days, where X represents the number of days remaining until the contract end date.
- The number of days left is converted into text using the TEXT function so that it can be included with the text using & the concatenation operator.
Then, verify that the formula is valid and click Check Syntax. Optionally fill in the Description and Help Text as alternatives. After that, click on the Next.

6. Select the Profiles to which you want to give the edit access of the field. After that, click on the Next button.

7. Select the Page Layout where you want to add the field. If you don’t select the page layout, the field will not added. Click Save to save the formula field.

You can check the result of the if date is less than the formula result. For this, click on the Details section, and you will get the Validation field for the Contract.


Conclusion
I hope you have understood how to create the formula if the date is less than in Salesforce.
You may also like to read:
- Remove comma from number field Salesforce
- Difference between Two Datetime Fields in Salesforce
- New Contact button missing from Accounts in Salesforce
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.