You need to sign in to do that
Don't have an account?

Isn't there a better way to evaluate many picklist values in an IF statement?
I feel like, despite searching and eliminating some options, I must be overlooking something that would make this a much cleaner formula in 2023. This State/Province is a picklist field, and if any of the following are selected on the parent record it drives this IF statement. This way of writing it WORKS and passes, but it's so prehistoric. Is there a better way yet?
IF(
AND(
SBQQ__ProductCode__c = '734000',
OR(
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'TX'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NY'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'VA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NC'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'KY'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'AL'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NJ'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'SC'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'FL'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'GA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'CA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'OK'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'MI'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'CO'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'AZ'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'UT')),
Dist_Test_Price__c < 16.50),
"Requires Exception",
"Pass")
IF(
AND(
SBQQ__ProductCode__c = '734000',
OR(
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'TX'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NY'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'VA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NC'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'KY'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'AL'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'NJ'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'SC'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'FL'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'GA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'CA'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'OK'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'MI'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'CO'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'AZ'),
ISPICKVAL(SBQQ__Quote__r.State_Province__c,'UT')),
Dist_Test_Price__c < 16.50),
"Requires Exception",
"Pass")
Are you using all pickilist values in the formula or specific values ?
If you are checking specific picklist values then formula is good.
If you are using all pickist values then you can make the formula like below.
If this helps, Please mark it as best answer.
Thanks!!