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
Mark Graham 3Mark Graham 3 

Formula from picklist values - help please?

I have been asked to make a custom weighting option for one of the smaller businesses in our org. 

If the sales manager picks one of the following picklist options during his opportunity creation, the formula should calculate as appropriate:

Custom Opp Weighting Picklist
Existing client, existing product =  divide opportunity amount by 2
Existing client, new product = divide opportunity amount by 3
New client, existing product = divide opportunity amount by 5
New client, new product = divide opportunity amount by 10

Is there an esy way I can I achive this via a picklist? 

Would really appreciate any help!
 
Best Answer chosen by Mark Graham 3
Abdul KhatriAbdul Khatri
If I understood correctly you need to display calculation based on the picklist value you mentioned above.

Here is my assumption:
You have a PickList value name Weighting__c with the following options
  1. Existing client, existing product
  2. Existing client, new product
  3. New client, existing product
  4. New client, new product

You need a formula field, based on the option selected in above PickList value
 
For Selection 1, formula will be Amount / 2 and so on.

With that in mind you can create a Forumla Field with DataType Number (Decimal 2) and in that have this code
 
CASE( Weighting__c , 'Existing client, existing product',  Amount / 2, 'Existing client, new product', Amount / 3, 'New client, existing product', Amount / 5, 'New client, new product', Amount / 10, 0)

Let me know your thoughts.

All Answers

Abdul KhatriAbdul Khatri
If I understood correctly you need to display calculation based on the picklist value you mentioned above.

Here is my assumption:
You have a PickList value name Weighting__c with the following options
  1. Existing client, existing product
  2. Existing client, new product
  3. New client, existing product
  4. New client, new product

You need a formula field, based on the option selected in above PickList value
 
For Selection 1, formula will be Amount / 2 and so on.

With that in mind you can create a Forumla Field with DataType Number (Decimal 2) and in that have this code
 
CASE( Weighting__c , 'Existing client, existing product',  Amount / 2, 'Existing client, new product', Amount / 3, 'New client, existing product', Amount / 5, 'New client, new product', Amount / 10, 0)

Let me know your thoughts.
This was selected as the best answer
Mark Graham 3Mark Graham 3
Thats perfect!! Thanks!!