How to count 3 picklist values(each is a set of numbers which are actually % values) and the 4th field is a formula which is a %? - Answers - Salesforce Trailblazer Community
Ask Search:
N SN S 

How to count 3 picklist values(each is a set of numbers which are actually % values) and the 4th field is a formula which is a %?

My requirement is to add 3 picklist values(numbers in intervals of 5) from 3 different picklist fields + a formula field value(return type is percent)

((VALUE(TEXT(picklist1_Percentage__c)))+ 
(VALUE(TEXT(picklist2_Percentage__c))) + 
(VALUE(TEXT(picklist3_Percentage__c))) + 
xxx_formula__c *100 )/100

The return type for the above is percentage. The formula works fine if the field values of all 3 picklist fields are entered. If any one picklist field is empty, then the calculation doesn't work. I am unable to use NOT(ISBLANK) for picklists as it throws an error. How can the sum of all the above fields can be done even if one o the fields is empty?
Best Answer chosen by N S
Eldon KuzhyelilEldon Kuzhyelil
Hey,

Can you try with the following formula,
 
(IF(ISBLANK(VALUE(TEXT(picklist1_Percentage__c))), 0, (VALUE(TEXT(picklist1_Percentage__c)))) + 

IF(ISBLANK(VALUE(TEXT(picklist2_Percentage__c))), 0 , (VALUE(TEXT(picklist2_Percentage__c)))) + 

IF(ISBLANK(VALUE(TEXT(picklist3_Percentage__c))), 0 , (VALUE(TEXT(picklist3_Percentage__c)))) + 

xxx_formula__c *100 )/100

Regards
 

All Answers

Yasser NabanguiYasser Nabangui
Hello, 

Maybe you can use a "0" value as default value. So you will have "0" instead of BLANK value. 
Eldon KuzhyelilEldon Kuzhyelil
Hey,

Can you try with the following formula,
 
(IF(ISBLANK(VALUE(TEXT(picklist1_Percentage__c))), 0, (VALUE(TEXT(picklist1_Percentage__c)))) + 

IF(ISBLANK(VALUE(TEXT(picklist2_Percentage__c))), 0 , (VALUE(TEXT(picklist2_Percentage__c)))) + 

IF(ISBLANK(VALUE(TEXT(picklist3_Percentage__c))), 0 , (VALUE(TEXT(picklist3_Percentage__c)))) + 

xxx_formula__c *100 )/100

Regards
 
This was selected as the best answer
N SN S
@Eldon Kuzhyelil 

Thank you. That worked :)