How can I create a Formula number field with the 'If, Else' statement?

How can I create a Formula number field with the 'If, Else' statement?

Currently, there is no option to create a Formula number field with the 'If, Else' statement. You can only create a formula field with the IF condition. However, you can achieve the If, Else statement using the If condition.

For example, you want to create a formula number field that returns the following output:

If field name contains 'Yellow', then return 265 ; Else if field name contains 'Red' return 295; Else if field name contains 'Blue' return 665; Else return 0.

Then, you can define the following formula:

If( Contains( $Contacts.fieldname, 'Yellow') , 265, 

If(Contains($Contacts.fieldname,'Red'),295 , 
If(Contains($Contacts.fieldname,'Blue'),665, 0 ) ) )
    • Related Articles

    • How to create auto number field?

      You can create an auto number field by following the steps given below: Log in to CRM with Administrator privileges. Click Setup > Customization > Fields. Select the Module from the drop-down list. In the [Module] Fields page, click New Custom Field. ...
    • Formula Fields

      A formula field is made up of three elements: Functions, Arguments and Operators. A Function expresses the dependence between two quantities, one of which is input and the other which is output. In other words, function performs a specific operation ...
    • How to create a lookup field?

      You can create Lookup Field by following the steps given below. Please note that lookup fields cannot be created for Tasks and Events. Log in to CRM with Administrator privileges. Click Setup > Customization > Fields. Select the Module from the ...
    • Create Solutions

      In CRM, you can create solutions by: Entering data in the solution details form: You can manually fill in the Solution details gathered from various external sources. Importing solutions from external source: You can gather data through various ...
    • Create Records

      You can create records in the Leads, Accounts, Contacts, Potentials, Tasks, Events, Calls, Cases, Products, Vendors, Quotes modules. To create records Go to the module. Tap Add icon. Specify the details and tap Save. Delete Records Occasionally, you ...