I was given a task while employed by an organization to determine whether a date exceeds a certain date. It enables us to streamline workflows and processes depending on particular dates, as well as better manage and organize our data in Salesforce.
In this article, we will learn how to check if a date is greater than a specific date using a Salesforce Formula.
Salesforce Formula to Confirm if a Date is Greater Than a Specific Date
In Salesforce, to compare a date field with a predefined date value to see if the date is greater than the particular date, we create an advance formula field that finds whether a date is greater than a particular date or not.
In Salesforce, for comparing the set date value with the date field, we use the comparison operators Greater Than (>) or Greater Than or Equal to (>=).
For example, we want to check if the Cose Date field of a Case is greater than Today. So, for this, we define a Salesforce formula that looks like as follows:
IF( CloseDate > TODAY(), "True", "False")In this formula, the CloseDate field is compared to the result of the TODAY function. If the CloseDate is after today’s dates, the formula will return TRUE. Otherwise, it will return FALSE.
We can use this formula in various situations, including triggering workflows and automation, sorting and filtering data, and generating fields based on specific dates, among other applications.
Salesforce Formula: Check if Date Greater Than Specific Date
Here, are the steps to define a formula date greater than the specific 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 Navigation Bar.

- Look for the item to which we want to compare a date that is greater than a certain date. I choose the Product 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 the Amount + Extra Charge.
- Select Currency as the Formula Return Type. After that, click Next.

- Enter the date greater than the specific date formula in the Advance Formula editor. Here is the formula:
IF(Payment_Due_Date__c > Purchase_Date__c + 5,
IF(Payment_Due_Date__c > Purchase_Date__c + 10, Price__c + 100, Price__c + 50),
Price__c
)- The IF() function is used in this formula to determine whether the payment due date is greater than the Purchase Date + 5 Days.
- If so, a second IF() function is used to determine whether the payment deadline exceeds the Purchase Date + 10 Days.
- If so, the price is increased by 100 rupees “Price__c + 100”. If not, the price is increased by 50 rupees “Price__c + 50”.
- The formula returns the original price “Price__c” if the payment due date is not more than 5 days after the Purchase 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 the Payment Due Date, Purchase Date, and Price fields by opening the Products item and saving it.
- After that, click on the Details section, and here the Amount + Extra Charge field appears which shows how the formula date is greater than the specific date works.



When the Payment Due Date is greater than the Purchase Date + 10 Days.
Conclusion
In conclusion, we learned the advanced salesforce formula to check the date greater than the specific date.
Moreover, we have learned that both Salesforce Classic and Salesforce Lightning offer a straightforward procedure for checking if a date is greater than a specific date.
You may also like to read:
- Difference between Two Datetime Fields in Salesforce
- Salesforce Formula to Calculate Days Between Dates
- Salesforce Formula to get Last Day of Month
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.