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
Michelle Littlefield 8Michelle Littlefield 8 

Formula with picklist options not working

I'm trying to create a formula for a custom field, where the picklist value of another field set it as a certain number. If the value is high, give the value 10, if Medium give 5, and if Low, 2. My formula is below. I keep getting various errors, this one in particular giving me the following error: "Error: Field Technology_Risk__c may not be used in this type of formula"

I'm new to formulas, do my formatting may be WAY off. Can anyone help?

IF( ISPICKVAL(Technology_Risk__c, "High") , "10" ,
IF( ISPICKVAL(Technology_Risk__c, "Medium") , "5" ,
IF( ISPICKVAL(Technology_Risk__c, "Low") , "2", null)))
Best Answer chosen by Michelle Littlefield 8
Naren9Naren9
Based on your screenshot, you are trying to create a Field of Number Type with this Formula not the Formula Field.
In regular fields, we can't use this kind of formula.

Try below steps to create a new Formula Field.

User-added image
User-added image
I have tried with different Picklist field.
User-added image

All Answers

Naren9Naren9
You Can try this way:
Formula Field Should of Type Number and 0 Decimal.
And below is the Formula Exoression:

CASE( Technology_Risk__C,
  "High", 10,
  "Medium", 5,
  "Low", 2,0)

I have tried in my Org and it is working.

Thanks,
Narendar
Michelle Littlefield 8Michelle Littlefield 8
Thanks Narendar! I've tried that, and I'm getting the same error. Is CASE intended for the cases object only? If it helps to provide more context, this is for a field on a custom object called Program Enrollment.
Naren9Naren9
Technology_Risk__C is a Field or Formula Field?.
In the Above expresson, CASE can be used on any Object. it is nothing related to Case Object.

 
Michelle Littlefield 8Michelle Littlefield 8
Technology_Risk__C is a picklist field on the same object
Naren9Naren9
Ok. I got it. Technology_Risk__C is a picklist field.
Other Field you are doing the Calculation is a Field or Formula Field?. If it is a formula Field, what is the Type -Number or Text or .
Please provide the screen shot of the error when you are doing the Syntax Check.
Michelle Littlefield 8Michelle Littlefield 8
The other field I'm trying to populate is a numerical field, 2 places with no decimals. Here is a screen shot for you! I really appreciate your help.

User-added image
Naren9Naren9
Based on your screenshot, you are trying to create a Field of Number Type with this Formula not the Formula Field.
In regular fields, we can't use this kind of formula.

Try below steps to create a new Formula Field.

User-added image
User-added image
I have tried with different Picklist field.
User-added image
This was selected as the best answer
Michelle Littlefield 8Michelle Littlefield 8
That worked!! Thank you so much!!