Formula field to look up the picklist value of a field, based on the picklist value of another field
Formula field to look up the picklist value of a field, based on the picklist value of another field
I have 4 category picklist fields on Account, each with a picklist value of Red, Amber, Green. As an example, an account can be Green in Category A, Amber in Category B, Red in Category C and Green in Category D, or any combination of these.
On the opportunity, I also have a Channel picklist field, with the categories from Account: A, B, C & D as the options.
I want a field on the opportunity that says: If the Opportunity Channel is A, then return the value from the Account field Category A, if the Opportunity Channel is B, then return the value from the Account field Category B, and so on.
I can’t get it to work. I’ve tried just starting with part of the formula so I can build it from there.
I used ISPICKVAL
IF(ISPICKVAL( Channel__c ,"Corporate"),
ISPICKVAL( Account.RAG_Corporate__c ),"FALSE")
And got: Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 1
Description
I used Case
IF(ISPICKVAL( Channel__c ,"A"),
CASE(TEXT( Account.Category_A__c ),Null))
And got Error: Incorrect number of parameters for function 'CASE()'. Expected 2, received 2 (don’t understand that at all).
How do you include 2 picklist values, can anyone help please?
ISPICKVAL(field, value) requires
2 parameters, but you gave it only one in ISPICKVAL(Account.RAG_Corporate__c).
The CASE() function expects a field and a set of matches with return values, but you were giving it just one.
Try this formula below:
IF(
ISPICKVAL(Channel__c, "A"),
TEXT(Account.Category_A__c),
IF(
ISPICKVAL(Channel__c, "B"),
TEXT(Account.Category_B__c),
IF(
ISPICKVAL(Channel__c, "C"),
TEXT(Account.Category_C__c),
IF(
ISPICKVAL(Channel__c, "D"),
TEXT(Account.Category_D__c),
"No Match"
)
)
)
)