How to do IF and nested IF functions in Excel

The IF function is one of the most useful you will ever learn in Microsoft Excel. It’s also incredibly simple and can unlock some seriously juicy functionality when you start nesting IF statements.

 

In this post, we’ll show you how to do an IF and a nested IF in Excel.

 

IF functions at heart are pretty simple. They return a certain value if a certain condition is met and another value if it isn’t. Think about it like this:

 

If you have a list of data and corresponding numbers and you want to label those over a certain number “Over” and those under a certain number “Under” the IF function would allow you to do that.

 

In this video, we use an IF function to show you exactly this.

 

*WARNING – For this to make sense we assume you already know about a few other Excel operators such as less than (<), greater than (>), equal to (=).

 


BUT WHAT IF…

 

See what I did there? But seriously, what if I have more than two conditions, it’s not an either or, it’s an either or, or…

 

If I’ve not completely confused you, then it’s time to look at combining multiple IF functions to add multiple conditions.

 

It’s pretty simple really, instead of choosing your second operator =IF(A1>A2,”correct answer”,“incorrect answer”), you put another IF function in! =IF(A1>A2,”correct answer”,IF(….

 

In other words:

 

Whereas IF() is used when the outcome includes only two possibilities—one value appearing if the condition tested is true, the other if false—nested IFs are used to choose between more than two results. Continuing with the film table example, suppose you want to label all films released prior to 1999 as ‘Pre-99’; those released in 1999 as ‘99’; and those that came after as ‘Post-99’. Then the formula in E2 would look like this:

 

=IF(D2<1999,”Pre-99″,IF(D2=1999,”99″,IF(D2>1999,”Post-99″)))

Using nested IFs to return more than two possible values

 

The IF Function is an ESSENTIAL part of your business Excel toolkit. If you’re not getting to grips with it you could be wasting countless hours doing repetitive and manual tasks in a spreadsheet when you simply don’t need to

 

It’s why it features so high up in our Definitive 100 Most Useful Excel tips which you can download for free here.

 

We hope you enjoyed this post! The IF function and hundreds more are covered in our full Excel course.