What is the Excel IFERROR Function?
The IFERROR Function in Excel is a built-in feature that returns a pre-determined value in the case of a calculation error, rather than an error message.
How to Use IFERROR Function in Excel?
The Excel IFERROR function is utilized to identify and prevent error messages from appearing in a spreadsheet.
Using the IFERROR function is one method to ensure that errors within a financial model are brought to the attention of the user with a custom value.
Some of the most common error messages that trigger the âIFERRORâ function are the following types:
- â#VALUE!â: One of the more general error messages that occurs when one of the values in a formula contains an inconsistency, such as attempting to add a cell containing text as part of a numerical calculation.
- â#REF!â: The cell reference is not valid, which is often a result of a cell that was formerly a part of a calculation that is accidentally deleted or moved elsewhere.
- â#DIV/0!â: The formula is attempting to divide a number by zero.
- â#NUM!â: The formula cannot be calculated due to limitations or errors. A multitude of problems could be the source of the problem, but frequently it is related to the calculation output being either too small or too large.
- â#NAME?â: The syntax in the formula contains an unrecognized cell reference or named cell (or range), or maybe quotations are missing.
- â#NULL!â: The formula involves a cell that contains an empty value, or an accidental space.
In practice, the most common custom returned value is âNAâ, âN/Aâ or ân.a.â, which refers to the phrase ânot applicableâ.
The general rule of thumb is that the returned value should be in the form of text, as opposed to a number.
For example, if the returned value is the number â0â, a mistake could easily be made where the cell containing the error is included in a calculation with an actual numerical value.
Excel IFERROR Function Formula Syntax
The formula for using the IFERROR function in Excel is as follows.
- âvalueâ â The formula that the function checks to confirm there is no error.
- âvalue_if_errorâ â The custom returned value if an error is identified by Excel.
If there is no error, the calculation in the first input is performed as normal, otherwise, the error message is shown (and the error is âtrappedâ).
IFERROR Function Calculator â Excel Model Template
Weâll now move on to a modeling exercise, which you can access by filling out the form below.
Step 1. Income Statement Assumptions
Suppose weâre in the initial stages of building an income statement forecast.
The financials for the companyâfrom revenue (the “top line”) to the gross profit line itemâare as follows.
Income Statement | 2021A | 2022E | 2023E |
---|---|---|---|
Revenue | $80 million | $100 million | $120 million |
Less: COGS | ($85 million) | ($85 million) | ($85 million) |
Gross Profit | ($5 million) | $10 million | $20 million |
Step 2. â#DIV/0!â Error Message
In the next step, weâve added a line item to calculate the year-over-year growth rate (YoY) of the companyâs revenue.
Weâll calculate the YoY growth rate by taking the current year revenue, dividing it by the prior year revenue, and subtracting one from the result.
- Revenue Growth YoY, 2021A = #DIV/0!
- Revenue Growth YoY, 2022E = 25.0%
- Revenue Growth YoY, 2023E =20.0%
However, there is no historical data for Year 0 (2021A), so an â#DIV/0!â error message appears.
In order to prevent our model from showing the error message, weâll wrap our YoY growth formula with the following âIFERRORâ function.
Step 3. Manual Error Message Catching in Financial Models
In the final part of our quick lesson, weâll show an example of an error that is not necessarily an âerrorâ, per se, to Excel.
Here, weâve calculated the gross profit for each period, so we can determine the gross margin by dividing the gross profit by the revenue in the corresponding year.
- Gross Margin, 2021A = (6.3%)
- Gross Margin, 2022E = 10.0%
- Gross Margin, 2023E =16.7%
The outlier is Year 0 (2021A), since the gross margin is a negative figure, which is clearly an âerrorâ yet Excel would not recognize it as such.
Therefore, weâll enter the following formula to handle the error manually.
The formula states that if the gross margin is less than zero, then return the âNAâ error message.
If the gross margin is greater than zero, however, the calculated gross margin should be returned as usual, as performed in the next two periods.
In cases such as the example shown here, âNMâ or âN/Mâ can be used as the returned error message, which refers to the phrase ânot meaningfulâ.
For the most part, ensuring there are no calculations that are unreasonable (or not plausible) in a model results in a cleaner, more intuitive financial model.
Other instances where these issues can require a manual entry âIFâ function to catch an error would be in the following scenarios:
- âUnbalancedâ Balance Sheet: Most balance sheets in 3-statement financial models contain a âCheckâ row to confirm the balance sheet is in fact âbalancedâ, i.e. the accounting equation is true, wherein the sum of the companyâs liabilities and equity equals its assets.
- Revolver Non-Compliance: In a debt schedule, the revolving credit facilities, i.e. ârevolversâ, must be modeled with the borrowing limit in mind. If the company borrowing needs to exceed the total capacity (i.e. the upper limit), an âIFâ function can be used to show an error message such as âNon-Compliantâ or âOverdrawnâ.
- Negative Pre-Tax Income: A financial model could mistakenly tax-affect the negative earnings of an unprofitable company with no taxable income. For companies that are either unprofitable or barely profitable, the recommendation is to wrap the income tax provision line with an âIFâ function that first confirms that the pre-tax income of the company is positive.