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!

Common Excel Errors
| Error | What Happened |
|---|---|
| #DIV/0! | Divided by zero or empty cell |
| #N/A | VLOOKUP 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 |
IFERROR - The Simple Fix
IFERROR checks your formula. If error, show something else instead.
Formula: =IFERROR(your_formula, show_this_if_error)

Example 1: Division by Zero
Without IFERROR:
| A (Sales) | B (Days) | C (Daily Average) |
|---|---|---|
| 100 | 5 | =A1/B1 → 20 |
| 200 | 0 | =A2/B2 → #DIV/0! |
With IFERROR:
=IFERROR(A2/B2, 0) → Shows 0 instead of error
Practice: Handle Division by Zero
EasyDivide A1 by B1, but show 0 if there is an error.
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
EasyUse VLOOKUP to find "Orange" in A1:B2. Show "Not Found" if error.
Example 3: Show Blank
Sometimes you want nothing to show:
=IFERROR(your_formula, "")
The "" means blank (empty). No error message, just blank cell.

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
| Wrong | Right | Why |
|---|---|---|
| =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 messages | You won't know if real problem exists |
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 Want | Formula |
|---|---|
| Show 0 if error | =IFERROR(formula, 0) |
| Show text if error | =IFERROR(formula, "Not Found") |
| Show blank if error | =IFERROR(formula, "") |
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!