Library

IF ERROR

What it's for

IFERROR doesn't calculate anything on its own — its whole job is to watch another formula and step in if that formula produces an error, replacing the error with something more useful to look at.

When you'd use it

Anytime a formula might reasonably fail under normal, expected conditions — like dividing by a cell that's sometimes empty, or looking up a value that won't always exist yet. IFERROR turns a jarring red error message into something calmer, like a blank cell or a short note.

How it works

IFERROR takes two things: the formula you actually want to run, and what to show instead if that formula fails. If the first part works normally, IFERROR doesn't change anything at all — it only steps in when there's an actual error to catch.

A worked example

fx
=IFERROR(A2/B2, "N/A")

If B2 has a number in it, this behaves exactly like a normal division. If B2 is empty or zero, Excel would normally show a #DIV/0! error — instead, this shows "N/A."

A tip worth knowing

IFERROR catches every kind of error, not just the one you're expecting. If there's a typo, a broken reference, or some other mistake elsewhere in the formula, IFERROR will hide that too, showing the same fallback text as if everything were working correctly. It's worth testing a formula on its own first, before wrapping it in IFERROR, so you know what you're actually catching.

Have a formula of your own you're stuck on?

Paste it and get an explanation →