Simply put, a condition in Excel can be either true or false. For example, 1 > 0 is a condition that is true while 1 < 0 is false. In Excel, there are many times that you need to evaluate a condition in order to decide what to do next. For example, you want to check the years that a certain employee has been working for you company to decide the number of days off per year that person is allowed to have, you will need to evaluate a value called working period as the example below:
As you can see, the column F contains the number of working period of our employees. The logical test is:
If (Working Period > 20)
If the condition is evaluated to true, then it the days off per year will be 40, otherwise, the number would be 10.
You may wonder, what if I want to have a more complex condition? Can I have more than 2 results, such as if the number of working period is bigger than 10, the days off would be 10, if it’s less than 10, the days off would be 5.
In such case, you may need to nest the IF function as below:
As you can see, there are two IF functions test two different condition. The first condition is still if the working period is > 20. However, the value_if_false of the outer is not a single value anymore, it’s another IF function. The condition of the inner IF is to test if the working period is more than 10, if the condition is true, the number of days off is 10, otherwise, it’s 5. You can build a very complex condition using this logic.
So, that’s how you use conditions in Excel. Most of the time, you will use condition with the IF function. You can build a simple condition or a very complex one, depends on your need.
If you find the post helpful, please share it. Thanks!