Salesforce Formula Date Greater Than Specific Date

You’ve come to the right place if you want to learn about Salesforce’s Advance Formula Date Greater Than the Specific Date. Additionally, we’ll cover how to use Salesforce Lightning and Salesforce Classic to generate a formula date greater than a particular date.

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.

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

  • Salesforce formula to confirm if date is greater than a specific
  • Formula date greater than specific date in Salesforce Lightning
  • Formula date greater than specific date in Salesforce Classic

Salesforce formula to confirm if date is greater than a specific

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 many different situations, including triggering workflows and automation, sorting and filtering data, and generating fields based on particular dates, etc.

In conclusion, we have learned the formula to confirm if the date is greater than a specific one in Salesforce. Next, we will move and learn how to check the date greater than the specific date in Salesforce Lightning.

Read Remove comma from number field Salesforce

Formula date greater than specific date in Salesforce Lightning

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

Step 1: Click the Setup icon in the top right corner of the page to access Salesforce Setup.

Step 2: Click Object Manager from the menu’s left side.

Salesforce formula to confirm if date is greater than a specific
Salesforce formula to confirm if date is greater than a specific

Step 3: 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.

Salesforce formula to confirm if date is greater than a specific example
Salesforce formula to confirm if date is greater than a specific example

Step 4: Choose Fields & Relationships.

Step 5: Next, select New.

Salesforce advance formula to confirm if date is greater than a specific
Salesforce advance formula to confirm if date is greater than a specific

Step 6: Choose the Formula as the field type.

Step 7: Click Next to proceed.

Salesforce advance formula to confirm if date is greater than a specific example
Salesforce advance formula to confirm if date is greater than a specific example

Step 8: 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.

Step 9: Select Currency as the Formula Return Type. After that, click Next.

Formula date greater than specific date in Salesforce Lightning
Formula date greater than specific date in Salesforce Lightning

Step 10: 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 the Purchase Date + 5 Days.

Step 11: To verify that the formula is valid, click Check Syntax.

Step 12: We can specify how you want to handle the empty field and include the Description and Help Text as alternatives.

Step 13: Then, select Next.

Formula date greater than specific date in Salesforce Lightning Example
Formula date greater than specific date in Salesforce Lightning Example

Step 14: Select the appropriate field Level Security and to make it visible to everyone, here we select the Visible checkbox.

Step 15: Select Next.

Advance formula date greater than specific date in Salesforce Lightning
Advance formula date greater than specific date in Salesforce Lightning

Step 16: Select the Page Layout Name for which the formula field is to be added.

Step 17: Click Save to save the formula field.

Advance formula date greater than specific date in Salesforce Lightning Example
Advance formula date greater than specific date in Salesforce Lightning Example

We can use the formula field once we’ve created it. 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.
Date greater than specific date in Salesforce Lightning
When the Payment Due Date is less than the Purchase Date + 5 Days
Date greater than specific date in Salesforce Lightning Example
When the Payment Due Date is greater than the Purchase Date + 5 Days.
Salesforce Formula date greater than specific date

When the Payment Due Date is greater than the Purchase Date + 10 Days.

As a result, we now know how to use Salesforce Lightning’s advanced formula date greater than a specific date. Next, we’ll look at how to use Salesforce Classic’s advance formula to check a date greater than a specific date.

Read Salesforce Last Activity Date Formula

Formula date greater than specific date in Salesforce Classic

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

Step 1: From the Salesforce Lightning to open your Salesforce Classic edition. Click on Avtar and click Switch to Salesforce Classic.

Formula date greater than specific date in Salesforce Classic
Formula date greater than specific date in Salesforce Classic

Step 2: Click on the Setup option.

Formula date greater than specific date in Salesforce Classic Example
Formula date greater than specific date in Salesforce Classic Example

Step 3: Scroll down to the Build section. Then under Customize, select the object for whom we want to compare a date that is greater than a certain date. Here, I choose the Campaigns from the object list.

Step 4: Click on the dropdown menu and select Fields.

Advance formula date greater than specific date in Salesforce Classic
Advance formula date greater than specific date in Salesforce Classic

Step 5: As you scroll down the page, click on the New button under Custom Fields & Relationships.

Advance formula date greater than specific date in Salesforce Classic example
Advance formula date greater than specific date in Salesforce Classic example

Step 6: Select the Formula as the field type.

Step 7: Click Next to proceed.

Date greater than specific date in Salesforce Classic
Date greater than specific date in Salesforce Classic

Step 8: Enter a Field Label for the formula, and the Field Name will be automatically populated. Here, I enter Field Label as the Upcoming Date.

Step 9: Choose Date as the Formula Return Type and then click Next.

Date greater than specific date in Salesforce Classic Example
Date greater than specific date in Salesforce Classic Example

Step 10: Enter the date greater than the specific date formula in the Advance Formula editor. Here, is the formula:

IF(DAY( EndDate ) > 15,
    DATE(YEAR(EndDate), MONTH(EndDate) + 1, 5),
    DATE(YEAR(EndDate), MONTH(EndDate), 30)
)
  • The IF() function is used in this formula to determine whether the Campaign End Date day of the month is greater than 15.
  • If so, the Upcoming Campaign Date is set to the 5th of the next month using the DATE() method.
  • The year and month of the Campaign End Date are extracted using the YEAR() and MONTH() functions, and the next month is obtained by adding 1 to the current month.
  • The Upcoming Campaign Date is set to the 30th of the same month using the year and month of the Campaign End Date and the DATE() function if the day of the Campaign End Date is less than or equal to 15.

Step 11: To verify that the formula is valid, click Check Syntax.

Step 12: We can specify how you want to handle the empty field and include the Description and Help Text optionally.

Step 13: Then, click Next.

Salesforce Classic Formula date greater than specific date
Salesforce Classic Formula date greater than specific date

Step 14: Choose the appropriate Field’s Level Security, and then check the box Visible to make it visible to all.

Step 15: Click Next.

Salesforce Classic date greater than specific date
Salesforce Classic date greater than specific date

Step 16: Choose the Page Layout Name for which the formula field is to be added.

Step 17: Click Save to save the formula field.

Salesforce Classic example date greater than specific date
Salesforce Classic example date greater than specific date

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

  • Create a new campaign with the End Date field value by opening the Campaigns tab and saving it.
  • In the details section, we will get the Upcoming Date field which shows how the formula date is greater than the specific date works.
salesforce classic example date greater than specific date formula
When Campaign End Date is less than the 15th of the month
salesforce classic advance formula date greater than specific date
When Campaign End Date is greater than the 15th of the month

In a conclusion, we now understand the formula date greater than the specific date.

You may also like to read

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 provide a simple procedure for checking the date greater than the specific date.

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

  • Salesforce formula to confirm if date is greater than a specific
  • Formula date greater than specific date in Salesforce Lightning
  • Formula date greater than specific date in Salesforce Classic