0

I have a picklist with 4 text values. I want to assign a numeric value to each text value. I then want to multiply the chosen value by a number field.

Can anyone help me with the syntax?

  1. Picklist field = Plan_object__c
  2. Number Field = R_Complex__c
  3. Picklist Values = Low,High,Medium,None

2 Answers 2

1

Try this as your custom formula field (type Number)

R_Complex__c * 
CASE (Plan_Object__c,
          "Low",1,
          "Medium",2,
          "High",3,
          "None",0,
          NULL)

where the values of 1,2,3 for low/medium/high are illustrative only

3
  • 1
    Not sure how your answer is different from mine other than giving him the exact answer, isn't the point to help them learn and not do it for them?
    – Jenny B
    Jan 2, 2015 at 15:55
  • 1
    perhaps -- in your answer, you copied straight from the Success page from a 2006 post and the copy included merge field syntax which for formula fields is not required (which is how I interpreted the question). I think when I answered this I was coming off a long threaded convo where I realized I needed to be more explicit and so was primed for explicitness when I got here. That said, I certainly agree that OP should have tried something first before I answered.
    – cropredy
    Jan 5, 2015 at 17:48
  • Gotcha, fixed the example to be a more recent example!
    – Jenny B
    Jan 5, 2015 at 18:35
1

I would suggest using Case with your picklist field, take a look at this formula example here:

    CASE(StageName,
"Prospecting", "Insert 1st Document ID",
"Qualification", "Insert 2nd Document ID",
"Needs Analysis", "Insert 3rd Document ID",
"Value Proposition", ...
)

In this example the result is text but you would instead assign a numeric value assigned based on the choices and then multiply the results by your R_Complex__c numeric field.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .