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
venkat bojjavenkat bojja 

Need formula for below requirement

Hi Team,
I have one  requirement.
I need to write formula field...

I have a check_box__c field 
1) check_box__c checked or uncheked +  Type__c != 'ABC' we need to make the Discount__c field blank.

2)  check_box__c checked + Type__c = 'ABC' then we need to do like below
 
Model_Type__cDiscount
Model 11000
Model 22000
Model 33000
Model 44000

Please help me on this. Thanks in Advance...
Thanks 
Venkat.
David BerenatoDavid Berenato
IF(
Type__c != 'ABC', NULL,

IF(
AND( check_box__c , Type__c = 'ABC'),
CASE(Model_Type__c,
'Model 1', '1000',
'Model 2', '2000',
'Model 3', '3000',
'Model 4', '4000',
NULL),NULL))

I did this assuming Discount__c was a text field and Model_Type__c was a picklist. If Discount is a number you can remove the quotes.
AnkaiahAnkaiah (Salesforce Developers) 
Hi Venkat,

try with below formula. and the Discount formula return type will be number.
IF(AND(check_box__c,ISPICKVAL(Type__c,"ABC"),ISPICKVAL(Model_Type__c,"Model 1")),1000,
    IF(AND(check_box__c,ISPICKVAL(Type__c,"ABC"),ISPICKVAL(Model_Type__c,"Model 2")),2000,
	IF(AND(check_box__c,ISPICKVAL(Type__c,"ABC"),ISPICKVAL(Model_Type__c,"Model 3")),3000,
	IF(AND(check_box__c,ISPICKVAL(Type__c,"ABC"),ISPICKVAL(Model_Type__c,"Model 4")),4000,0))))

If this helps, Please mark it as best answer.

Thanks!!