Skip to content

Excel function guide · Logic

IFERROR function in Excel

IFERROR returns the result of a formula, or a value you choose if that formula produces an error such as #DIV/0! or #N/A. It's most often wrapped around divisions and lookups.

Syntax

=IFERROR(value, value_if_error)
ArgumentRequired?What it means
valueRequiredThe formula to try, for example B2/C2 or a lookup.
value_if_errorRequiredWhat to return if it errors: 0, "" (looks blank), or a message in quotes.

IFERROR examples

Every example uses this small table. The results are what Excel shows in the cell.

ABC
1StoreRevenueOrders
2Leeds18,400230
3York9,600120
4Hull00
5Bath12,150135
  1. 1. The problem

    =B4/C4

    Result: #DIV/0!

    Hull had no orders, so revenue per order divides by zero.

  2. 2. Replace the error

    =IFERROR(B4/C4, "No orders")

    Result: No orders

    Same calculation; the error is replaced with a message. On Leeds' row the same formula returns 80.

  3. 3. A lookup that may fail

    =IFERROR(VLOOKUP("Derby", A2:C5, 2, FALSE), "Not listed")

    Result: Not listed

    Derby isn't in the list, so VLOOKUP's #N/A becomes Not listed.

Try it now

Practise IFERROR in a live sheet.

Type each formula yourself. Answers are checked by the same engine as the full course. No account needed.

Try it · IFERROR
0 XP
D2
A
B
C
D
E
F
1
Store
Revenue
Orders
Per order
Lookup
Answer
2
Leeds
18400
230
Store
Derby
3
York
9600
120
Revenue
4
Hull
0
0
5
Bath
12150
135
6
7
8
Double-click or start typing to edit

Step 1 of 3

In D2, calculate revenue per order (B2/C2), wrapped in IFERROR so an error shows 0.

Common IFERROR mistakes

Practise this in Excel Quest

AND, OR & IFERROR Members

Course 4 · Logic & Error Handling · 12 min

Combine conditions into real hiring rules and handle errors gracefully. The lesson covers AND, OR and IFERROR together, building real hiring rules.

This lesson is included in Formula Quest memberships. A free account starts you on the free lessons of the Excel Quest curriculum.

Related functions

All Excel function guides