Validation rules are placed as custom formula fields to verify if users’ inputted values meet specific requirements before they can be saved. A Salesforce validation field should always have error message.
Validating formula fields can also be used to gateway whether a workflow rule should be executed or not. Consider Salesforce formulas to be similar to Excel formulas, whose equations are executed at run-time, when the process is executing.
IF and ISx, where x can be NULL or a set value, are conditional statements to the formula. TODAY() is a function that takes the system’s current date (of Today) and executes an operator, which in this case is -, denoting subtraction.
So in the first line, the formula looks to see if the record has been closed. It does so by looking at the custom field, Close_Date__c, to see if it’s NULL. If it is NULL, that means the record remains opened. Therefore, the formula then takes the System’s TODAY(), date-value, and subtracts it by the stored value in Open_Date__c, of when the record was logged as opened. Otherwise, if there’s a value for Close_Date__c, meaning there’s no NULL value, then the record must have been closed. If that’s so, then simply subtract the Close_Date__c by the Open_Date__c