I wrote a validation rule I would like to make better. It should show and error message if the sum of a number of fields must equal the value in another field when saving a record. If any field has blank/null value it should treat it as zero. I would like to know is there a better or more efficient(refactor) way of writing this validation rule.
(
IF( ISBLANK(Payment_1__c) , 0, Payment_1__c) +
IF( ISBLANK(Payment_2__c) , 0, Payment_2__c) +
IF( ISBLANK(Payment_3__c) , 0, Payment_3__c) +
IF( ISBLANK(Payment_4__c) , 0, Payment_4__c) +
IF( ISBLANK(Payment_5__c) , 0, Payment_5__c)
) <> Total_Amount__c