+ Start a Discussion
babacandoitbabacandoit 

Text-Formula

Hi All,

I am creating a custom Formula-Text-field 'Level of Disount'.
depending on Disount-Range, Level of Disount must be changed,

Here goes the My Formula,

//--->Formula starts here
IF((Discount_Percentage__c >=5 || Discount_Percentage__c<=10) , 'Level-1',
IF((Discount_Percentage__c >=10 || Discount_Percentage__c<=20), 'Level-2',
IF((Discount_Percentage__c >=20 || Discount_Percentage__c<=30), 'Level-3',
IF((Discount_Percentage__c >=30 || Discount_Percentage__c<=40), 'Level-4',
'No Disount'))))
//---Formula End here <---

For all the Discount_Percentage__c it is showing Only Level-1 :(

Thanks in Advance. 

Cheers
Baba
 
Best Answer chosen by babacandoit
Shingo YamazakiShingo Yamazaki
Maybe you should use AND(&&) operator, not OR(||)

//--->Formula starts here
IF((Discount_Percentage__c >=5 && Discount_Percentage__c<=10) , 'Level-1',
IF((Discount_Percentage__c >=10 && Discount_Percentage__c<=20), 'Level-2',
IF((Discount_Percentage__c >=20 && Discount_Percentage__c<=30), 'Level-3',
IF((Discount_Percentage__c >=30 && Discount_Percentage__c<=40), 'Level-4',
'No Disount'))))
//---Formula End here <---


All Answers

Shingo YamazakiShingo Yamazaki
Maybe you should use AND(&&) operator, not OR(||)

//--->Formula starts here
IF((Discount_Percentage__c >=5 && Discount_Percentage__c<=10) , 'Level-1',
IF((Discount_Percentage__c >=10 && Discount_Percentage__c<=20), 'Level-2',
IF((Discount_Percentage__c >=20 && Discount_Percentage__c<=30), 'Level-3',
IF((Discount_Percentage__c >=30 && Discount_Percentage__c<=40), 'Level-4',
'No Disount'))))
//---Formula End here <---


This was selected as the best answer
babacandoitbabacandoit
Hey Shingo, 

Thanks, Thanks in Ton :) 

Cheers..
Baba