Excel IFERROR

IFERROR returns your formula's result, or an alternative you choose if the formula produces an error.

A marketing report divides spend by clicks, and one new campaign has no clicks yet. That single #DIV/0! spoils the table and any total below it. IFERROR shows a clean message while the rest of the report carries on.

Practice it now

How to write it

=IFERROR(value, value_if_error)
value
The formula to try.
value_if_error
What to show if it fails.

Watch it work

E2fx 
ABCDEF
1CampaignSpendClicks
2Alpha300150
3Beta1200
4Gamma500200
5
1

No error, so the result shows normally.

Examples

Cost per click for Alpha

=IFERROR(B2/C2,"No clicks")2

No error, so the result shows normally.

Cost per click for Beta

=IFERROR(B3/C3,"No clicks")No clicks

Division by zero is replaced.

Return a number instead

=IFERROR(B4/C4,0)2.5

A numeric fallback keeps later maths working.

Your turn

Divide Beta's spend by its clicks, showing 0 if there's an error. Type your formula in E2.

ABCDE
1CampaignSpendClicks
2Alpha300150
3Beta1200
4Gamma500200
5

Common mistakes

Wrapping everything by habit.

It also hides real faults such as typos. Use it only for errors you expect.

Using 0 where unknown is meant.

A 0 can drag down averages. A blank or text is sometimes more honest.

Good to know

  • Build the formula first and add IFERROR last.
  • Use IFNA for lookups so other errors still show.
  • IFERROR or IFNA? IFERROR catches every error type. IFNA catches only #N/A.