An IF statement is a function in excel which can be used to produce outputs if conditions that we have set are proved true or false.
In this tutorial, I am going to show you how to create a basic IF statement.
- Create or have ready data that is comparable such as current salary and budgeted salary.
- We now need to type our formula in cell F2. The IF statement formula is =IF(logical_test, [value_if_true],[value_if_false])
- Logical_test – This is asking us what our criteria is, in our example our criteria is to find out if the current salary is less than or equal to the budgeted salary. Therefore, we will click on the first current salary data in cell D2 and then type <= after this click cell E2 which is the first budgeted salary entry. Type a comma to close the current function.
- Value_if_true – This is asking us what we want to display if our statement is true. In our example, it will display “Within Budget if our current Salary (D2) is less than Budgeted Salary (E2). We need to type in “Within Budget” with speech marks. Speech marks are used to let Excel know that we want the cell to display text. We can then type a comma to close the current function and move on to the next.
- Value_if_false – This is asking us what we want to display if our statement is not true. In our example, it will display “Over Budget” if Current Salary is not less than budgeted Salary. We will type “Over Budget” in speech marks. Once this is done we can now close the brackets, click enter and then drag the formula down.
We can now quickly see that majority of the salaries are within budget. If we drag down the formula further towards total we can see that although some salaries were over budget overall, total salaries are still under budget.