Using conditions
Conditions are ways of carrying out a calculation to provide a true or false outcome. They are used to provide branches in logic, so if one condition is met, then action A will ensue. If not, then something else will happen.
If
The most common and useful condition is the If
function, which takes in three arguments:
- The test
- What to do if the test returns
true
- What to do if the test returns
false
In the following example, you will see that we can also combine the outputs of other functions into our condition to return a different output:
If(Text(Today(),"dddd") = "Saturday","Weekend :)","Weekday :(")
Figure 6.17: An example of an If function being used to change the output of a label
There will be occasions where your condition will depend on multiple inputs being compared to provide the evaluation. Multiple conditions will always be either AND
or OR
in nature and can...