function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eesha.SinghEesha.Singh 

I want to create a formula field to return a calculated value based on a pick list and a checkbox field

What I need is if the payment request picklist value is "Full" and The Spin Kicker Checkbox is checked then the Spin Amount should return the value * 1.5
Else if the checkbox is not checked then it should return the value based of the Payment Request picklist value
My formula is as follows:
IF(
ISPICKVAL(Payment_Request__c,"Full"),
AND(SPIN_Kicker__c= True))
VALUE(TEXT(SPIN_Amount__c)*1.5),

IF(ISPICKVAL(Payment_Request__c,"1st Half"),
VALUE(TEXT(SPIN_Amount__c))*0.5,

IF(ISPICKVAL(Payment_Request__c,"2nd Half"),
VALUE(TEXT(SPIN_Amount__c))*0.5,

VALUE(TEXT(SPIN_Amount__c))

)))

Something is not correct, I think I have to use Case. Please advise
sagarika bsagarika b
Hi Singh,

Change your code like this in formula, and you will get Values
IF(AND((ISPICKVAL(Payment_Request__c,"Full")),(SPIN_Kicker__c==true))  , SPIN_Amount__c*1.5, IF(AND((ISPICKVAL(Payment_Request__c,"1st Half")),(SPIN_Kicker__c==true))  , SPIN_Amount__c*0.5, IF(AND((ISPICKVAL(Payment_Request__c,"2nd Half")),(SPIN_Kicker__c==true))  , SPIN_Amount__c*0.5, SPIN_Amount__c) ) )

I hope it will helpful

Thanks
Sagarika

 
Eesha.SinghEesha.Singh
Thanks Sagrika. I worked it out using Case.
CASE( 
Payment_Request__c, 
"Full", IF(SPIN_Kicker__c= TRUE, VALUE(TEXT(SPIN_Amount__c))*1.5, 
VALUE(TEXT(SPIN_Amount__c))), 

"1st Half",IF(SPIN_Kicker__c= TRUE, VALUE(TEXT(SPIN_Amount__c))*2.0, 
VALUE(TEXT(SPIN_Amount__c))*0.5), 

"2nd Half", VALUE(TEXT(SPIN_Amount__c))*0.5, 
NULL 
)