#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
Module 2
5 min

Error Handling

Handle errors gracefully with IFERROR and other functions

Error Handling - Fix Ugly Error Messages

Ever see #DIV/0! or #N/A in your spreadsheet? These error messages look unprofessional. Let's fix them!

Error Handling Overview


Common Excel Errors

ErrorWhat Happened
#DIV/0!Divided by zero or empty cell
#N/AVLOOKUP or MATCH could not find value
#VALUE!Wrong type (like text instead of number)
#REF!Cell reference is broken or deleted
#NAME?Typo in function name
5 rows

IFERROR - The Simple Fix

IFERROR checks your formula. If error, show something else instead.

Formula: =IFERROR(your_formula, show_this_if_error)

IFERROR Example


Example 1: Division by Zero

Without IFERROR:

A (Sales)B (Days)C (Daily Average)
1005=A1/B1 → 20
2000=A2/B2 → #DIV/0!
2 rows

With IFERROR:

=IFERROR(A2/B2, 0) → Shows 0 instead of error

Practice: Handle Division by Zero

Easy

Divide A1 by B1, but show 0 if there is an error.

A
B
C
D
E
F
1
2
3
4
5
6

Example 2: Lookup Not Found

=VLOOKUP("Mango", A1:B10, 2, 0) → #N/A (not found)

With IFERROR:

=IFERROR(VLOOKUP("Mango", A1:B10, 2, 0), "Not Found")

Result: Shows "Not Found" instead of #N/A

Practice: Handle Lookup Error

Easy

Use VLOOKUP to find "Orange" in A1:B2. Show "Not Found" if error.

A
B
C
D
E
F
1
2
3
4
5
6

Example 3: Show Blank

Sometimes you want nothing to show:

=IFERROR(your_formula, "")

The "" means blank (empty). No error message, just blank cell.

IFERROR Blank


Real Examples

Safe Division

=IFERROR(Sales/Days, 0)

Lookup with Default

=IFERROR(VLOOKUP(ID, Data, 2, 0), "Unknown")

Blank if Error

=IFERROR(A1*B1, "")


Common Mistakes

WrongRightWhy
=IFERROR(0, A1/B1)=IFERROR(A1/B1, 0)Formula goes first, backup goes second
=IFERROR(A1/B1)=IFERROR(A1/B1, 0)Missing second part - what to show if error
Hide all errors with ""Use meaningful messagesYou won't know if real problem exists
3 rows

Best Practice

Use helpful messages:

Bad: =IFERROR(VLOOKUP(...), 0)

Good: =IFERROR(VLOOKUP(...), "Product not found")

This way, users know what happened!


Quick Reference

What You WantFormula
Show 0 if error=IFERROR(formula, 0)
Show text if error=IFERROR(formula, "Not Found")
Show blank if error=IFERROR(formula, "")
3 rows

Summary

IFERROR makes your spreadsheet look professional:

  • No ugly #DIV/0! errors
  • No confusing #N/A messages
  • Show helpful messages instead

Formula: =IFERROR(your_formula, backup_value)

Use it everywhere you might get errors!

SkillsetMaster - AI, Web Development & Data Analytics Courses