Practice by topic / Excel / Conditional Logic

IFERROR Exercises

IF-style formulas let a spreadsheet make decisions — pass or fail, on time or late, which rate applies — so you don't have to check each row by hand. These 10 exercises build up step by step, starting with handle a failed lookup gracefully, handle a successful lookup, provide a default for a missing match.

3 of 10 free · no sign-up needed · graded on the formula you write

1

Handle a Failed Lookup Gracefully

Free

A2 holds a product name to look up in B1:C3, but it might not be found. Write a formula in D2 that returns the price if found, or 'Not Found' if the lookup errors.

ABCD
1Widget10
2GizmoGadget15?
Show the solution

Wrap the VLOOKUP in IFERROR: =IFERROR(VLOOKUP(A2,B1:C2,2,FALSE),"Not Found")

Right — wrapping VLOOKUP in IFERROR replaces the raw #N/A with a friendly fallback message.

Expected result in D2: Not Found

Try it in the live spreadsheet →
2

Handle a Successful Lookup

Free

A2 holds a product name that IS in the table B1:C2. Write a formula in D2 that returns the price using IFERROR wrapping VLOOKUP (should return the real value, not the fallback).

ABCD
1Widget10
2WidgetGadget15?
Show the solution

Same pattern: =IFERROR(VLOOKUP(A2,B1:C2,2,FALSE),"Not Found")

Good — when the lookup succeeds, IFERROR simply passes the real value through unchanged.

Expected result in D2: 10

Try it in the live spreadsheet →
3

Provide a Default for a Missing Match

Free

A2 holds a customer ID to look up in B1:C2, which might not contain it. Write a formula in D2 that returns 0 as a default if the lookup fails.

ABCD
110050
299920075?
Show the solution

Wrap in IFERROR with a numeric fallback: =IFERROR(VLOOKUP(A2,B1:C2,2,FALSE),0)

Right — using 0 as the fallback keeps downstream sum/average formulas from breaking.

Expected result in D2: 0

Try it in the live spreadsheet →
4

Fallback for a Missing Employee Record

A2 holds an employee ID to look up in B1:C2. Write a formula in D2 that returns 'Unknown' if the employee isn't found.

ABCD
1E1Alex
2E5E2Sam?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
6

Fallback Price Lookup With a Zero Default

A2 holds a SKU to look up in B1:C2. Write a formula in D2 that defaults to 0 if the SKU isn't in the table.

ABCD
1SKU-125
2SKU-1SKU-240?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
7

Combine IFERROR With a Text Message

A2 holds a part number to look up in B1:C2. Write a formula in D2 that returns 'Check part number' if the lookup fails.

ABCD
1P10012
2P404P20018?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
9

Fallback for a Matched Order Lookup

A2 holds an order ID that IS present in B1:C2. Write a formula in D2 confirming IFERROR passes through the real matched value.

ABCD
1ORD1250
2ORD1ORD2180?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →
10

Provide a Numeric Default for a Rate Lookup

A2 holds a tier code to look up in B1:C2 for a commission rate. Write a formula in D2 that defaults to 0.05 if the tier isn't found.

ABCD
1T10.1
2T1T20.08?

Solution and instant grading: open it in the practice app (use one of your 20 free picks, or Pro).

Try it in the live spreadsheet →