Youâ€™ve come to the right place if you want to learn about** Salesforceâ€™s Advance Formula Date Less Than Today**. Additionally, weâ€™ll cover how to use Salesforce Lightning and Salesforce Classic to generate a formula date less than today.

While working for an organization, I was assigned a job to determine whether a date is less than the current date. It enables us to manage and organize our data in Salesforce more effectively, as well as streamline workflows and processes based on today’s date.

The following are the topics that we will cover in this salesforce tutorial:

- Salesforce Formula for Date Less Than Today
- Formula for Date Less Than Today in Salesforce Lightning
- Formula for Date Less Than Today in Salesforce Classic

## Salesforce Formula for Date Less Than Today

In Salesforce, we build an advance formula field that determines whether a date is less than a today date or not in order to compare a date field with a today date value to check if the date is less than the today date.

In Salesforce, we utilize the comparison operators Less Than (<) or Less Than or Equal to (<=) to compare the value of the set date with the today field.

For instance, we want to see if the object’s date field is less than today. Therefore, we define a Salesforce formula that looks like this:

```
DateField < TODAY()
#OR
DateField <= TODAY()
```

In this formula, we check if the date field is less than today’s date. For this, we use the **TODAY()** function, **less or equal** operator, and compare it with the date field.

This formula can be applied in a wide range of situations, such as triggering workflows and automated processes, sorting and filtering data, creating fields depending on today’s date, etc.

**In conclusion, we now know how to check in Salesforce if a date is less than today’s date using a formula. The next step is to learn how to use Salesforce Lightning to verify dates that are before today date.**

Read Salesforce Formula Date Greater Than Specific Date

## Formula for Date Less Than Today in Salesforce Lightning

Here, are the steps to define a formula date less than today’s 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 compare a date that is less than today’s date. I choose the
**Contract**object from the list of objects in this instance.

- Choose
**Fields & Relationships**. - Next, select
**New**.

- Choose the
**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 Field Label as**Validation**. - Select
**Text**as the Formula Return Type. After that, click**Next**.

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

- 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, here 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 weâ€™ve created it. Letâ€™s look at an example:

- Create a
**Contract**with the**Contract Start Date**, and**Contract Term**fields by opening the**Contracts**item and saving it. - After that, click on the
**Details**section, and here the**Validation**field appears which shows how the formula date is less than today’s date works.

As a result, we now understand **how to use the advance formula date less than today’s date in Salesforce Lightning**. Next, we’ll look at **how to check a date that is less than today using the advance formula in Salesforce Classic**.

Read Salesforce Formula Field to Calculate Age

## Formula for Date Less Than Today in Salesforce Classic

Here, are the steps to define a formula date greater than the specific date in Salesforce Classic.

- From the Salesforce Lightning to open your Salesforce Classic edition. Click on
**Avtar**and click**Switch to Salesforce Classic**.

- Click on the
**Setup**option.

- Scroll down to the
**Build**section. Then under**Customize**, select the object for whom we want to compare a date that is less than a current date. Here, I choose the**Products**from the object list. - Click on the dropdown menu and select
**Fields**.

- As you scroll down the page, click on the
**New**button under**Custom Fields & Relationships.**

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

- Enter a
**Field Label**for the formula, and the**Field Name**will be automatically populated. Here, I enter**Field Label**as**Extra Charge**. - Choose
**Currency**as the Formula Return Type and then click**Next**.

- Enter the date less than today’s date formula in the Advance Formula editor. Here, is the formula:

`IF( Payment_Due_Date__c < TODAY(),( TODAY() - Payment_Due_Date__c) * 5, 0 )`

The **IF** function determines whether the product’s payment due date called **“Payment_Due_Date__c”** is today or later.

If so, it returns the number of days remaining until the payment due date using the formula and multiplies it by 5 to calculate the extra charges. Otherwise, it returns 0 as the extra charge.

- 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**optionally. - Then, click
**Next**.

- Choose the appropriate
**Fieldâ€™s Level Security**, and then check the box**Visible**to make it visible to all. - Click
**Next**.

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

Once weâ€™ve defined the formula field, we may use it. Letâ€™s explore an example:

- Create a new product with the
**Payment Due Date**field value by opening the**Products**tab and saving it. - In the details section, we will get the
**Extra Charges**field which shows how the formula date is less than today’s date works.

**In a conclusion, we now understand the formula date is less than today’s date.**

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

## Conclusion

In conclusion, we learned the advanced salesforce formula to check the date is less than the current date.

Moreover, we have learned that both Salesforce Classic and Salesforce Lightning provide a simple procedure for checking the date less than today’s date.

In addition to this, the following are the topics that we have discussed:

- Salesforce Formula for Date Less Than Today
- Formula for Date Less Than Today in Salesforce Lightning
- Formula for Date Less Than Today in Salesforce Classic

Read ABS() Function in Salesforce | Calculate absolute value 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.