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:
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: 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: 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 NowNext up:
- What’s new in SharePoint 2013 for developers
- Think Leader. Think Legacy. Think Auntie Marg.
- SQL Server 2014: In-Memory Database Capabilities
- How to create a PivotTable using Excel VBA
- Database indexing issues in Exchange Server 2013
- Creating a drop-down list in Microsoft Excel
- And if you tell that to the young folks today…
- How to convert text to columns in Microsoft Excel
- Configure Windows Intune for SCCM 2012 R2 – Part 1
- Enhance your presentations with PowerPoint’s Slide Zoom
Previously
- Where did my Acrobat tab go in Microsoft Word?
- What’s new in SQL Server 2014 Database Development
- “Hey Rocky, watch me pull a rabbit out of my hat!” said Bullwinkle the trainer
- Monetise your Windows Store Apps
- Using custom fields to calculate GST in Microsoft Project
- Make CSS3 animations stay put after they’ve performed
- Data Deduplication in Windows Server 2012: The Solution for Ennui!
- Leonardo, Steve and Basil
- Creating Building Blocks in Microsoft Outlook
- A Closer Look at Excel PowerPivot and Power View