This little gem finds its way into Matric finals over and over again. It takes some practice to get your head around the logic, so let’s begin!

Truth be told, a nested IF solution can always be replaced by the far superior LOOKUP functions.

Your standard IF statement has 3 parts and goes something like:

- If something is true,
- do this,
- otherwise do that.

Let us say it is sports day at school and we need to award gold, silver and bronze medals to the first three athletes in an event. Following the above logic for the IF statement:

- If the athlete placed first
- award them the gold medal
- otherwise, award them the silver medal

Oh dear: that won’t work — no bronze medal! Let’s try again:

- If the athlete is in first place
- award them the gold medal
- if the athlete placed second
- award them the silver medal
- otherwise, award them a bronze medal.

Here we have an IF statement that has an IF statement “inside” of it as the FALSE part of the first, main IF statement. Now we need Excel to perform this logic…

The formula in cell C2 (which can then be copied downwards) is:

`=IF(B2=1,"GOLD",IF(B2=2,"SILVER","BRONZE"))`

The following would also work:

`=IF(B2<2,"GOLD",IF(B2<3,"SILVER","BRONZE"))`

In the second example, 1 is less than 2 AND 1 is less than 3, so how does Excel decide whether to award GOLD or SILVER?

Excel evaluates the conditions from left to right and stops as soon as the condition is met. So in the above example, the function returns GOLD and exits.