Default to zero on missing discount (VLOOKUP + IFERROR)
The problem
Problem statement
You are processing store checkouts. Members get a discount based on their VIP tier in A2:B5 (Bronze 5%, Silver 10%, Gold 15%, Platinum 20%). Non-VIP customers have standard tiers like 'Regular' or 'None' that are NOT in the VIP table, causing a naked VLOOKUP to fail with #N/A. Fill the Discount cells E2:E5 using VLOOKUP wrapped in IFERROR (or IFNA) so missing tiers safely default to 0.
The fallback must be the number 0, not the text "0" — case 2's non-VIP tier still feeds later arithmetic.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | D | E | |
|---|---|---|---|---|
| 1 | VIP Tier | Discount | Member Tier | Discount |
| 2 | Bronze | 0.05 | Gold | |
| 3 | Silver | 0.1 | Regular | |
| 4 | Gold | 0.15 | Silver | |
| 5 | Platinum | 0.2 | None |
Notes
When lookup outputs feed directly into arithmetic (e.g. Total * (1 - Discount)), returning a text like 'Not found' or letting #N/A bubble up will break the whole formula. Wrapping VLOOKUP in IFERROR with a 0 fallback keeps calculations running cleanly.
How to approach
Your answer goes in E2:E5. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.
- Target cells are E2:E5 — start in E2, then fill down
- Build the core lookup first:
VLOOKUP(D2, $A$2:$B$5, 2, FALSE) - Wrap it in
IFERROR:IFERROR(..., 0) - Do not put quotes around 0 — it should be a numeric zero, not text
Official solutions
Show 2 solutions — try it yourself first
Approach 1: IFERROR with numeric zero fallback
=IFERROR(VLOOKUP(D2, $A$2:$B$5, 2, FALSE), 0)
If D2 exists in the VIP table, VLOOKUP returns the tier discount. If the customer is not a VIP (#N/A), IFERROR intercepts it and returns 0.
Approach 2: IFNA targeted lookup intercept
=IFNA(VLOOKUP(D2, $A$2:$B$5, 2, FALSE), 0)
IFNA specifically intercepts lookup misses (#N/A) without hiding formula syntax errors or broken table ranges (#REF!).
Function guide
FAQ
Why return 0 instead of "No Discount"?
When the discount cell is later multiplied by the order amount (e.g. Price * (1 - Discount)), text causes a #VALUE! error. A numeric 0 allows subsequent math formulas to compute without errors.
Should I use IFERROR or IFNA for VLOOKUP?
IFNA is generally preferred for lookups because it only suppresses #N/A (lookup miss). IFERROR will also silence #REF! (deleted column), which could mask critical worksheet bugs.