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 ...
    • Formula Field Examples

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

      A formula field will automatically calculate and derives its value by referring to the value of the specified fields or the numeric, text, or date values given in the formula. You can customize fields with formulas using functions like numeric, ...
    • Formula Field Functions

      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 Recruit formula type custom field supports four ...
    • 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 ...