How to Use Excel IFERROR to Hide Formula Errors

The Ugly Error Cascade

You build a beautiful financial dashboard in Excel. It calculates profit margins, growth percentages, and revenue per employee. You send it to your boss. The next morning, your boss calls you and says, “Your spreadsheet is broken. Half the cells just say #DIV/0! and #VALUE!”

The spreadsheet is not actually broken. The formulas are correct. The problem is that some cells are currently empty because the data for the current quarter has not been entered yet. When a formula tries to divide by an empty cell (which Excel treats as zero), it produces a #DIV/0! (Division by Zero) error. When a formula tries to perform a mathematical calculation on a cell containing text, it produces a #VALUE! error.

These error codes are technically correct, but they make your dashboard look ugly, unprofessional, and broken to non-technical readers. To fix this, Excel provides a universal error-handling wrapper formula called IFERROR. It allows you to intercept any formula error and replace it with a clean, custom message of your choice, like a blank space, a zero, or the words “Pending Data.”

The Syntax

The IFERROR formula is one of the simplest in all of Excel. It only takes two arguments.

=IFERROR([Your original formula], [What to show if it errors])

You simply wrap your existing formula inside IFERROR. Excel will attempt to calculate the original formula first. If the formula works perfectly, IFERROR does nothing and displays the correct result. If the formula crashes and produces any type of error (#DIV/0!, #VALUE!, #N/A, #REF!, etc.), IFERROR catches the crash mid-flight and replaces the ugly error code with whatever clean value you specified in the second argument.

Practical Example: Fixing Division by Zero

Imagine Cell B2 calculates profit margin with the formula =A2/C2. If C2 (Total Revenue) is currently empty because it is only January, the formula crashes and displays #DIV/0!.

To fix this, simply wrap the formula in IFERROR.

=IFERROR(A2/C2, 0)

If C2 has data, the formula calculates normally. If C2 is empty and the formula would crash, IFERROR intercepts the error and calmly displays 0 instead of the terrifying red error code.

Displaying Custom Messages

Instead of showing a zero, you can display any custom text message you want. This is incredibly useful for dashboards that are reviewed by non-technical managers.

=IFERROR(A2/C2, "Awaiting Data")

Now, instead of a confusing #DIV/0!, the cell will cleanly print the words “Awaiting Data,” instantly communicating to the reader that the missing number is expected and not a software bug.

You can also display a completely blank cell by using an empty string:

=IFERROR(A2/C2, "")

This makes the cell appear completely empty and clean, as if no formula exists in it at all.

Wrapping Legacy VLOOKUP Formulas

One of the most common uses of IFERROR is to fix legacy VLOOKUP formulas. If VLOOKUP searches for a value that does not exist in the database, it throws a #N/A error. This is the single most annoying error in corporate Excel spreadsheets.

=IFERROR(VLOOKUP(A2, Database!A:C, 3, FALSE), "Not Found")

With this wrapper, if VLOOKUP cannot find the employee ID, the cell will calmly print “Not Found” instead of crashing the entire dashboard.

Never send a dashboard covered in ugly red error codes to your manager. By wrapping your formulas in IFERROR, you can intercept every possible crash and replace it with a clean, professional, human-readable message.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.