Below are examples of formulas that can be used as Formula Fields or in your processes. Although the examples are for Case Management they can be edited for use with other objects and processes.
Automatically set the Case Due Date:
You can calculate the Due date based on the value of a Case field or from the createddate. For this example we will do both.
{!CreatedDate} + 10
Calculate the Case due data based on the CreatedDate plus 10 days.
IF( ISPICKVAL({!Priority}, “High”), {!CreatedDate} + 2, IF( ISPICKVAL({!Priority}, “Medium”), {!CreatedDate} + 5, {!CreatedDate} + 7))
Calculate the Case due date based on the Priority field. If the Priority is High then the due date is the Createddate plus 2 days. If the Priority is Medium then the due date is the Createddate plus 5 days. If the Priority is neither High or Medium then the due date is the Createddate plus 7 days.
Case Aging:
Calculates the number of days the case has been open if the case is not closed. The field can be used to sort lists or trigger processes.
IF( {!IsClosed},null, NOW() – {!CreatedDate} )
If the Closed field on the case is ‘true’ then do nothing. If the Closed field on the case is ‘false’ then the formula calculates today’s date minus the Createddate of the case. You can use another date from the case if necessary.
Case Categorization:
This formula builds off the Age formula but can be used with other Case fields. This formula displays a text value depending on case age (a custom field). This formula could be used for grouping or charting. For this example we will use colors.
IF( {!Case_Age__c} > 20, “RED”, IF({!Case_ Age__c} > 10, “YELLOW”, “GREEN”))
If Age formula field is greater than 20 then the Categorization is Red. If Age formula field is greater than 10 then the Categorization is Yellow. If Age formula field is neither greater than 20 or greater than 10 then the Categorization is Green.