You need to sign in to do that
Don't have an account?
Jerry Yang 8
Formula field to calculate a score based on a customers age
Dear SF Dev Community. I am trying to create a formula field for a custom object. The objective of the formula is to calculate a score based on the value given by another field in the same custom object.
The value given by the field called Age__c. This field output an age value based on the customer’s birthday, and based on this age value, we want to calculate a score.
Example:
If (Age__c >= 18 && Age__c <=24), if this is true, then the output score is 20, else
If (Age__c >= 25 && Age__c <=32) if this is true, then the output score is 30, else
Could anyone please give me some guidance on how to write this sort of if/else if statement? Thanks!
The value given by the field called Age__c. This field output an age value based on the customer’s birthday, and based on this age value, we want to calculate a score.
Example:
If (Age__c >= 18 && Age__c <=24), if this is true, then the output score is 20, else
If (Age__c >= 25 && Age__c <=32) if this is true, then the output score is 30, else
Could anyone please give me some guidance on how to write this sort of if/else if statement? Thanks!
If (Age__c >= 18 && Age__c <=24,20,
If (Age__c >= 25 && Age__c <=32 ,30,
If (Age__c >= 33 && Age__c <=39 ,25,
If (Age__c >= 40 && Age__c <=44 ,20,
If (Age__c >= 45 && Age__c <=54 ,15,
If (ISBLANK Age__C, Null,’’)
I am still getting the error Error: Incorrect parameter type for function 'IF()'. Expected Number, received Text
If (Age__c >= 18 && Age__c <=24 ,20,
If (Age__c >= 25 && Age__c <=32 ,30,
If (Age__c >= 33 && Age__c <=39 ,25,
If (Age__c >= 40 && Age__c <=44 ,20,
If (Age__c >= 45 && Age__c <=54 ,15,
If ( ISBLANK( Age__c ), NULL, '')
)))))
https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005ggjQAA