SQLExcelHTML & CSSTouch typingBlogChoose a course
Lurndo › Blog › Excel
  1. Short answer
  2. What do IFERROR and IFNA do in Excel?
  3. How do you write IFERROR and IFNA?
  4. Which errors does IFERROR catch?
  5. How do you catch #DIV/0!?
  6. How do you catch #N/A in a VLOOKUP?
  7. When does IFERROR hide a real mistake?
  8. What should you show instead of the error?
  9. Which functions go with these?
  10. Frequently asked questions

IFERROR and IFNA in Excel: catching errors without hiding the real ones

A #DIV/0! or #N/A looks messy, but it's information too. On the sheets of a swimming pool and a bike courier, you'll see how to catch them neatly, and when to leave them alone.

C

Christophe, founder of Lurndo
November 6, 2026 · 6 min read

IFERROR shows something else when a formula returns an error value, as in =IFERROR(E11/D11,"-"). It catches every error, including one from a typo in your formula. IFNA is more careful: it only catches #N/A, the error for "not found", and lets the rest through. So use IFNA around a lookup, and only wrap IFERROR around a formula once it works.

Exercise: right in your browser, on real data

Practise this: the lesson on IFERROR, free

Sources: 3 sources you can check

A paper safety net is stretched under a row of green spreadsheet cells and catches a few loose orange-tinted cells, while one red cell drops through a gap, on light green paper.

What do IFERROR and IFNA do in Excel?

IFERROR shows something else when a formula returns an error value, and otherwise just shows the result. =IFERROR(E11/D11,"-") divides E11 by D11 and shows a dash if that doesn't work. IFNA does the same, but only for the #N/A error, which you get when a lookup finds nothing. In a Dutch copy of Excel, they're called ALS.FOUT and ALS.NB.

Both are handy, and both can hide exactly what you should have seen. That's why the examples below use two sheets from our Excel course: The Splash swimming pool in Tamworth and Flying Velo bike couriers in Manchester. If you'd rather learn it step by step, follow the lesson on error values.

How do you write IFERROR and IFNA?

Both functions have two required arguments: the formula you want to check, and what should appear if it returns an error (Microsoft). In IFNA, the second argument is what you show for #N/A (Microsoft).

=IFERROR(value,value_if_error)
=IFNA(value,value_if_na)
ArgumentWhat it isExample
valueThe calculation or formula you're checkingE11/D11
value_if_errorWhat the cell shows on an error: text, a number or another formula"-"

Text: goes in quotation marks, as in any function. A number doesn't need them.

With Dutch or Belgian regional settings you'd write =ALS.FOUT(E11/D11;"-") and =ALS.NB(…;"-"). If the formula works, the function does nothing and you see the result itself. If you leave the second argument empty, IFERROR returns an empty string (Microsoft).

Which errors does IFERROR catch?

All seven error types Microsoft lists for it (Microsoft). Read them before you make them disappear, because each one tells you what's wrong.

ErrorMeaningIFERRORIFNA
#DIV/0!Dividing by zero or an empty cellCatches itLeaves it
#N/ANot foundCatches itCatches it
#VALUE!Calculating with text, or the wrong kind of argumentCatches itLeaves it
#REF!A reference that doesn't existCatches itLeaves it
#NAME?A name Excel doesn't know, often a typoCatches itLeaves it
#NUM!A number that isn't possibleCatches itLeaves it
#NULL!Two ranges that don't intersectCatches itLeaves it

How do you catch #DIV/0!?

Manager Dave at The Splash wants to know what each member pays per visit: the amount in column E divided by the visits in column D. Sara has never been and Laura's cell is empty, so the division returns #DIV/0! for both. An empty cell counts as 0 in a calculation.

RowA: NameD: VisitsE: Paid (£)G: Per visit
2Jack3155.00
3Nora2224010.91
4Mila9252.78
5Rita1524016.00
6Laura(empty)10#DIV/0!
7Rory6254.17
8Jim1824013.33
9Will4205.00
10Hannah11252.27
11Sara0240#DIV/0!

This is one of the clean uses of IFERROR. The error isn't a mistake: there's nothing to work out for Sara, and Dave wants a calm sheet. Try it yourself in Sara's row.

Try it: Sara without the error

In G11, work out what Sara pays per visit: the amount in E11 divided by the visits in D11. Show a dash "-" if that gives an error.

ABCDEFGH
1NameAgePassVisitsPaidCategoryPer visit
2Jack9Single3£15.00
3Nora34Annual22£240.00
4Mila15Monthly9£25.00
5Rita67Annual15£240.00
6Laura41Single£10.00
7Rory7Monthly6£25.00
8Jim72Annual18£240.00
9Will28Single4£20.00
10Hannah12Monthly11£25.00
11Sara55Annual0£240.00
12
G11

Your formula ran in your own browser, on a real calculation engine, and then again on a hidden version of the sheet with other amounts.

To be more precise, test the divisor with the IF function: =IF(D11=0,"-",E11/D11). That only catches division by zero. Microsoft warns that IFERROR suppresses all errors, not only #DIV/0! (Microsoft).

How do you catch #N/A in a VLOOKUP?

With IFNA, around the lookup. Dispatcher Kyle at Flying Velo looks up the customer's area for each ride. The customer list is in L2:M6: the code in column L, the area in column M. Ride R10 is for a new customer, K06, who isn't on the list yet. =VLOOKUP(B11,L2:M6,2,FALSE) returns #N/A there.

CodeArea
K01Manchester
K02Burnage
K03Manchester
K04Didsbury
K05Withington

That's not Kyle's mistake, but a real answer: this customer doesn't exist yet. Let's say so neatly. If VLOOKUP is new to you, the lesson takes it slowly, and the hints below will walk you through it here.

Try it: a new customer

In G11, look up the area for the customer in B11 in the list L2:M6, with VLOOKUP. Show "New customer" if the code isn't there, with IFNA.

ABCDEFGHIJKLMNOPQ
1RideCustomerZoneKmWeightPriceAreaSurchargeCustomer nameNameCodeAreaFrom kmPrice
2R01K03Centre2.53Bloom BakeryK01Manchester0£6.00
3R02K01Suburbs7.212Book NookK02Burnage3£9.00
4R03K05Docks11.425Cygnet CaféK03Manchester6£12.00
5R04K02Centre1.81Dot PrintK04Didsbury10£18.00
6R05K03Suburbs5.58Fork & SpokeK05Withington
7R06K04Docks9.918
8R07K01Centre34
9R08K02Suburbs610ZoneCentreSuburbsDocks
10R09K05Docks1430Surcharge£0.00£2.00£5.00
11R10K06Centre4.22
12
13PositionWeightCentreSuburbsDocksClassMedium
14Light£0.00£1.00£3.00ZoneDocks
15Medium£2.00£3.00£5.00Result
16Heavy£4.00£6.00£8.00
17
G11

XLOOKUP has this built in, as its fourth argument: =XLOOKUP(B11,L2:L6,M2:M6,"New customer") does the same without IFNA. It's shorter and just as safe. How the two lookups differ is covered in VLOOKUP vs XLOOKUP.

When does IFERROR hide a real mistake?

Whenever your formula itself is broken. IFERROR doesn't know why there's an error, only that there is one. Say Kyle accidentally asks for column 3 from a list of two columns. With IFERROR he notices nothing; with IFNA he does:

Formula, for ride R01 with customer K03Result
=VLOOKUP(B2,L2:M6,3,FALSE)#REF!
=IFERROR(VLOOKUP(B2,L2:M6,3,FALSE),"New customer")New customer
=IFNA(VLOOKUP(B2,L2:M6,3,FALSE),"New customer")#REF!

With IFERROR, every ride says "New customer", even for your most loyal customers, and nobody gets a warning. The same goes for a typo: =IFERROR(SUMM(E2:E11),0) shows £0 instead of #NAME?, and the sheet looks perfectly healthy.

Write your formula without IFERROR first and check it works. Only wrap the safety net around it once you know which error you're expecting.

What should you show instead of the error?

That's not a detail, because whatever you put there keeps calculating. Dave wants the average per visit from column G. With a dash for Laura and Sara, AVERAGE skips that text and he gets £7.43. With a 0, he gets £5.95: two members who tell you nothing about the price drag the average down.

On an error you showEffect in AVERAGEEffect in =G6*2
"-" or ""Skipped, £7.43#VALUE!, because it's text
0Counted, £5.950
The error itself#DIV/0!#DIV/0!

So only pick 0 if zero is really the answer. A cell that looks empty with "" holds text, and you can't multiply that. For more on what an average does and doesn't include, read the article on AVERAGE.

Which functions go with these?

There's a small group around an error value, and each member has a job of its own. Here they are with the example that suits them best.

FunctionWhenExample
IFERRORThe error is expected, whichever it is=IFERROR(E2/D2,"-")
IFNAA lookup is allowed to find nothing=IFNA(VLOOKUP(…),"Unknown")
IFYou know which case you want to catch=IF(D2=0,"-",E2/D2)
XLOOKUPA lookup with an alternative of its own=XLOOKUP(B2,L2:L6,M2:M6,"Unknown")

An average with no rows returns #DIV/0! too, as you'll see in AVERAGEIF and AVERAGEIFS. Every function is on the Excel cheat sheet with its Dutch name, and the 12 most useful Excel formulas give you a broader start. If you want to learn to read error values on a real sheet, follow module 3 of the Excel course. It's free.

Frequently asked questions

What's the difference between IFERROR and IFNA?

IFERROR catches every error value, from

How do you replace

With =IFNA(VLOOKUP(B2,L2:M6,2,FALSE),0), or "" in place of the 0. Think before you do. A 0 counts in an average, and "" is text, which can give an error if you calculate with it further on. A word such as Unknown is often the most honest.

How do you avoid

Wrap IFERROR around the division, as in =IFERROR(E2/D2,"-"), or test the divisor with IF: =IF(D2=0,"-",E2/D2). The second form is more precise, because it only catches division by zero. A typo or text in the cells still shows up as an error value.

Should you use IFERROR with XLOOKUP?

Usually not. XLOOKUP has its own fourth argument for what to show when it finds nothing, as in =XLOOKUP(B11,L2:L6,M2:M6,"Unknown"). That does the same as IFNA, but the formula stays shorter, and any other error in it stays visible. So IFERROR isn't needed here.

Why does IFERROR always show my alternative?

Because the formula returns an error in every row, and that's being hidden. Take IFERROR off for a moment and look at the error underneath. It's often a typo in a function name, a column number outside the range or a reference that no longer exists. Fix that, then put IFERROR back.

Practise this in the course

Every lesson explains first and then lets you practise yourself, with a real spreadsheet in your browser.

  • IFERRORLogic · Catching error values
  • VLOOKUPLookups · Looking up in a column
  • XLOOKUPLookups · Looking up in any direction
Start Excel for free

Sources

  1. Microsoft Support, IFERROR function
  2. Microsoft Support, IFNA function
  3. Microsoft Support, How to correct a
C

Christophe, founder of Lurndo

Christophe builds Lurndo from Belgium, with short, playful exercises for SQL, Excel, HTML & CSS and touch typing that show straight away what your answer does. On this blog, Christophe answers the questions people run into while learning, with sources you can check yourself.

Read next

  • AVERAGEIF and AVERAGEIFS examples: one condition or several, and why you get #DIV/0!Two functions with nearly the same name and their arguments in a different order. On a charity shop's real sheet you'll see when to use which, and where an average can lead you astray.Excel · November 6, 2026 · 7 min read
  • Excel COUNTIFS examples: counting with multiple criteria, including between two valuesHow many items over £5 did Grace sell? On a charity shop's real sheet you'll see how COUNTIFS counts row by row, and you can write one yourself right away.Excel · November 6, 2026 · 7 min read

SQL

  • Topics
  • All lessons
  • Cheat sheet
  • Sandbox

Excel

  • Topics
  • All lessons
  • Cheat sheet
  • Shortcuts

HTML & CSS

  • Topics
  • All lessons
  • Cheat sheet

Touch typing

  • Topics
  • All lessons
  • Cheat sheet
  • Typing test

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Blog
  • FAQ
  • Contact & support
  • Privacy

Ask AI about Lurndo

Nederlands