+ Start a Discussion
KNKKNK 

Formula field

Hi Team,

 

I have two fields in One Object Product_Mix__c(Number) and Product_MIx_Score(Formula(number)).

 

I am writing formula in Product_Mix_Score__c

 

CASE(TEXT(Product_Mix__c),
'<50.00', 2,
'50.00-100.00', 6,
'100.00-150.00', 9,
'150.00-200.00', 12,
'>200.00', 15,0)

 

but when i am entering 60 value in Product_Mix__c, the valye  6 is not getting populate in Product_Mix_Score__c

 

Can any one help me here.

Best Answer chosen by Admin (Salesforce Developers) 
Jeff MayJeff May

Your CASE is checking to see of the text of Product_Mix__c is equal to '< 50.00' or to '50.00 - 100.00', which it is not.  It is equal to '60'.  You can use IF to check for numeric comparison.  Since IF will detect TRUE at the first chance it gets, you can write it this way:

 

IF(Product_Mix__c > 200, 15, IF(Product_Mix__c > 150, 12, IF(Product_Mix__c > 100, 9, IF(Product_Mix__c > 50, 6, 2),0),0), 0)