Enhancing the IF function with nested IF functions in Microsoft Excel

 Mar 17, 2014

Out of all the Microsoft Excel‘s worksheet functions, the IF function is one of the most useful and versatile functions. Its purpose is to decide, based on a condition, whether to follow one course of action, or another. For example, if cell A1 has a positive number in it, it should display the word “profit,” but if it doesn’t have a positive number, it should display the word “loss.” In this case, the formula would read the following:

Enhancing IF Functions with Nested IF Functions in Microsoft Excel

However, there are times where such a simple IF statement doesn’t cover every possibility. In the example above, the formula would result in “loss” if cell A1 contained a negative number, but also if it contained zero. A zero would indicate that they broke even; it’s not a loss. To have an accurate reflection of this situation, we can enhance the IF function with nested IF functions.

How to use nested IF functions

To overcome the above problem, a Nested IF Function can be used to test a second condition. The above formula needs to first test to see if A1 has a positive number, but if it doesn’t, it then has to test to see if it has a negative number or not. If not, A1 must contain zero, so therefore they have broken even:

Enhancing IF Functions with Nested IF Functions in Microsoft Excel

This formula can read as saying: “If A1 is greater than zero, there is a profit. However, if A1 is a less than zero, there is a loss. If it’s neither of these cases, there is a break even.” If there were a fourth possibility, there could be a nested IF statement within the nested IF statement or there could nested IF statements in both the true and false parts of the original IF formula. For example: Enhancing IF Functions with Nested IF Functions in Microsoft Excel This formula can be read as saying: “If A1 is greater than zero then check if it’s more than 100 and if it is, then there’s a “big profit” and if not, there there’s a “small profit.” However, if A1 is less than zero, there’s a “loss” and if it’s not less than zero, there’s a “break even.” If you’d like to learn more about these functions, you should take a look at New Horizons’ Microsoft Excel training programs, and in particular Excel 2010 Level 2 and Excel 2013 Level 2.

How do your Excel skills stack up?   

Test Now  

About the Author:

Ben Kirk  

With over 16 years of experience working as a Desktop Applications specialist for a number of large education services providers, Ben is one of New Horizons most skilled and dynamic instructors. With his Advanced Diploma of Business Skills alongside his practical experience and expertise, Ben is able to provide insight and guidance to students at all skill levels across the entire Microsoft Office suite.

Read full bio
top