Sometimes you will want to add conditions to your formulas, for example you might want to use different calculations depending on what options in your form are selected.
if(Condition)
operation
else
operation
Example:
The condition above will check the value of the dropdown, if the “Option 1” is selected the formula value will be 1, otherwise it will be 2.
The else section is optional, if you want you can create many conditions like this:
In the example above the formula value will be 1 if option 2 is selected, 2 if option 2 is selected or 3 if option 3 is selected.
You can also do arithmetical operations inside the conditions for more complex calculations:
Creating multiple comparisons
You can also create multiple comparisons using && (for and) and || (for or). In an “And” comparison all the comparisons need to be true in order for the condition to be executed in an “Or” comparison at least one comparison needs to be true.
for example, if you want to compare if a number is greater than 10 AND lesser than 20 you can use this comparison:
alternatively, if you want to compare if a number is either 10 or 20 you could do so using the “Or” comparison