IF Function
- 03:20
Understand how to apply the IF function
Downloads
No associated resources to download.
Glossary
Circular Switch False Logical Test TrueTranscript
The if function performs a logical test and returns one value, if it's true, and another if it's false. If we look at the arguments here, it says if something is true, then do something, otherwise do something else.
A good example could be if your employee's appraisal grades are above a certain level, maybe above a five, then we give them a bonus. Otherwise, no bonus. In this example I said above and so I would need to use the greater than sign. And there are some commonly used operators with the if function, they are equals greater than, greater than or equal to less than, less than or equal to or does not equal. Let's have a look at an example in Excel.
Here we have sale amounts and I wanna look at these sale amounts and give a bonus to anyone where the transaction sale amount was greater than 240.
In J5 I'm going to write my if function. So I type equals if open brackets, then I'm going to use my keyboard to go to the left and select H5, the sale amount. So if that sale amount is greater than 240, and you can see at the top here, the syntax is helping us. It says, what is the logical test? So that's the sale amount being greater than 240. And what must happen if that is true, and what if it is false? So if the sale amount is above 240, then which is my comma? I want the word bonus to appear. Otherwise, if it's not true. So I press a comment the second time, then I want the words, no bonus to appear.
Press enter. And we can see the word bonus has now appeared because the sale amount of 250.3 is greater than 240.
I'm now going to copy that down. So Control C select the cells you want to paste to and then control V or enter, and we can See a second amount qualifies for a bonus, the amount in row 12 of 242.2. So the if function has allowed us to very quickly identify the two transactions that should be awarded bonuses.