
click to enlarge
At first glance, the format of a basic IF function in Excel may lead some users to believe that the function can only be employed in times when there are just two choices to be made such as in the example we gave in Part 1 of this series. However, it is possible to use IF statements when there are more than two cases if the functions are nested correctly.
A nested IF function is a statement that contains at least one IF function inside another. That is, a nested IF function contains another IF statement as one (or both) of the true/false values. In this manner, the original IF function checks for a condition and, depending on the result of that check, it may go on to check another condition. The diagram to the left gives a basic representation of how this process works. (Click the image for a larger view.)
A basic IF function is of the form below.
=IF(condition, value if true, value if false)
A more concrete example that we created in Part 1 of this series is the function IF(B2>=70,"PASS","FAIL").
On the other hand, nested IF functions can take on a variety of different appearances, depending on how complex the nesting sequence is. One example is shown below.
=IF(condition1, value1 if true, IF(condition2, value2 if true, value2 if false))