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, you can't create a Formula number field with the 'If, Else' statement. You can only create a formula field using the IF condition. However, you can also achieve the If, Else statement using the If condition.

Let's say you want to make sure that if a check box is enabled, the date field should be populated automatically by filling out next Friday. For example, if you enable the check box today, that date field should be filled with next Friday i.e 16-06-2017. Similarly, if you enable the check box by 17-06-2017, then the date field should be populated with 23-06-2017.

Then, you can define this formula:

If(And(${Deals.checkboxdate},Weekday(Now())==1),Datepart(Adddate(Now(),8,'DAY')),If(And(${Deals.checkboxdate},Weekday(Now())==2),Datepart(Now()),
If(And(${Deals.checkboxdate},Weekday(Now())==3),Datepart(Adddate(Now(),6,'DAY')),If(And(${Deals.checkboxdate},Weekday(Now())==4),Datepart(Adddate(Now(),5,
'DAY')),If(And(${Deals.checkbox date},Weekday(Now())==5),Datepart(Adddate(Now(),4,'DAY')),If(And(${Deals.checkbox date},Weekday(Now())==6),Datepart(Adddate(Now(),3,'DAY')),If(And(${Deals.checkbox date},Weekday(Now())==7),Datepart(Adddate(Now(),2,'DAY')),'')))))))
    • Related Articles

    • Examples of Formula Field

      Formula Fields can be complicated sometimes. So, here are examples that will help you understand the usage of these types of fields in Zoho CRM. IF ELSE Statement Example: If field name contains 'Golf Only 1 Meal', then return 265 ; Else if field ...
    • Creating Formula Fields

      Formula fields are used to calculate different types of values, including numeric values, text values, date values, etc. Formula fields and their resulting return value have certain data types associated with them and there are specific operators ...
    • Functions in Formula Fields

      Function performs a specific operation on values that you specify and generates a new value. To compose a function, you need to type the function name, followed by a set of parentheses(). The Zoho CRM formula type custom field supports four different ...
    • How can I create and send invoices?

      An invoice is a bill issued by a vendor to a customer with the goods or services they ordered. It usually contains the purchase order reference number, date, billing address, shipping address, terms of payment, and line items (products or services) ...
    • How do I create multiple sales pipelines?

      Pipelines can only be created for the Deals module. To create a pipeline, follow the steps below: To create a sales pipeline Go to Setup > Customization > Pipelines. Click New Pipeline. Enter a name and select the Layout to associate the pipeline ...