“If I’m hungry, I’ll eat.”
Basic human survival, we need to eat to survive. Am I hungry: yes or no? If yes, I’ll eat. If no, I won’t eat.
This is the most basic of IF tests, since it deals with a single question that will have one of two possible answers:
|If hungry = true, result = eat|
|If hungry = false, result = don’t eat|
|=IF([Hungry]=”True”,”Eat”, ”Don’t Eat”)|
We’ll test this by creating a custom list with two added columns. The first column is named Hungry, the type of information is Choice, and choices are displayed using Radio Buttons (see Figure 8-1).
Figure 8-1. First column
The second column, shown in Figure 8-2, is named Result, and the type is Calculated with the following formula:
Figure 8-2. Second column
Once we have our columns, create a new item on the list, as shown in Figure 8-3.
Figure 8-3. New list item
The results are shown in Figure 8-4.
Figure 8-4. Results view
Since we chose True for the answer to whether or not we were hungry, the result displayed is “Eat.”
Now go back and edit the item, but choose False this ...