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
Karen WheelerKaren Wheeler 

Picklist formula

I have a custom field that is a single value selection picklist with 6 available values.  I want to incorporate the conditional logic that the values from the formula below will only display if this field Customer Type has either of 2 of the 6 available picklist fields.

I've tried ISPICKVAL, which fails spectacularly, as do CASE and TEXT. I know it must be something in my syntax but I just can't seem to work it out.

Seems like it should be straightforward but for some reason it isn't working out. Any suggestions?

IF(AND( Revenue_Current_Mo__c >0, Revenue_Last_Mo__c =0,Remove_from_Reporting__c=False),"1st Mo. Rev.", 
IF(AND( Revenue_Current_Mo__c =0, Revenue_Last_Mo__c >0, Revenue_2_Mo_Ago__c =0,Remove_from_Reporting__c=False),"2nd Mo. NO Rev.", 
IF(AND( Revenue_Current_Mo__c >0, Revenue_Last_Mo__c >0, Revenue_2_Mo_Ago__c =0,Remove_from_Reporting__c=False),"2nd Mo. Rev.", 
IF(AND( Revenue_Current_Mo__c>0, Revenue_Last_Mo__c >0, Revenue_2_Mo_Ago__c >0, Revenue_3_Mo_Ago__c =0,Remove_from_Reporting__c=False),"3rd Mo. Rev.", 
IF(AND( Revenue_Current_Mo__c =0, Revenue_Last_Mo__c >0, Revenue_2_Mo_Ago__c >0, Revenue_3_Mo_Ago__c =0,Remove_from_Reporting__c=False),"3rd Mo. NO Rev.","")))))


 
Gokula KrishnanGokula Krishnan
Hi Karen,

I think 'Revenue_Current_Mo__c','Revenue_Last_Mo__c','Revenue_2_Mo_Ago__c ','Revenue_3_Mo_Ago__c ' are picklist fields and 'Remove_from_Reporting__c' is boolean field.

IF(Remove_from_Reporting__c=False,
IF(AND(VALUE(Revenue_Current_Mo__c )>0,VALUE(Revenue_Last_Mo__c) = 0),'1st Mo. Rev.',
IF(AND(VALUE(Revenue_Current_Mo__c )=0,VALUE(Revenue_Last_Mo__c) > 0,VALUE(Revenue_2_Mo_Ago__c ) = 0),'2nd Mo. NO Rev.',
IF(AND(VALUE(Revenue_Current_Mo__c )>0,VALUE(Revenue_Last_Mo__c) > 0,VALUE(Revenue_2_Mo_Ago__c ) = 0),'2nd Mo. Rev.',
IF(AND(VALUE(Revenue_Current_Mo__c )>0,VALUE(Revenue_Last_Mo__c) > 0,VALUE(Revenue_2_Mo_Ago__c ) > 0,VALUE(Revenue_3_Mo_Ago__c ) = 0),'3rd Mo. Rev.',
IF(AND(VALUE(Revenue_Current_Mo__c )>0,VALUE(Revenue_Last_Mo__c) > 0,VALUE(Revenue_2_Mo_Ago__c ) > 0,VALUE(Revenue_3_Mo_Ago__c ) = 0),'3rd Mo. Rev.',
)
)
)))
,false)

Thanks,

If it helps you, please mark is as best answer, so it will be helpful for other developers.