Logic function

IFERROR

Show something friendlier when a formula cannot answer.

Purpose

Show something readable when a formula cannot answer

Returns

The formula's own result, or your fallback if it errored

Syntax

=IFERROR(value, value_if_error)

ArgumentRequiredWhat goes here
valueRequiredThe formula to run, usually a lookup that might not find a match.
value_if_errorRequiredWhat to show instead of an error, like "Not on the chart of accounts".

How to use IFERROR

IFERROR runs the formula you give it and hands back the result. If the formula errors, it hands back your second argument instead.

Its proper use is an error you have already understood and decided what to do about. A supplier that is genuinely not on the terms table gets the standard thirty days, and saying so in the formula is better than a column of errors.

Its improper use is much more common: wrapping a formula you have not checked, so a wrong column number or a mistyped range quietly returns the fallback for every row and the schedule looks finished.

Write the lookup first. Get it right on a row you can check by eye. Only then wrap it.

Examples

Every result below is worked out by the same evaluator that marks your answers, on the sheet shown here.

Payables ageing — October.xlsxSheet1
Harbour Foods payables at 31 October 2026, with supplier terms alongside
ABCDEFGH
1InvoiceSupplierStatusDays overdueAmountSupplierTerms (days)
2INV-8801Brightwell PaperOverdue12940Ashgrove Catering30
3INV-8802Calder UtilitiesQueried471180Brightwell Paper30
4INV-8803Meridian FreightOverdue632450Calder Utilities14
5INV-8804Ashgrove CateringOn terms0405Meridian Freight45
6INV-8805Brightwell PaperOverdue38760Thornbury Print60
7INV-8806Thornbury PrintOverdue911320
8INV-8807Meridian FreightOn terms0580
9INV-8808Calder UtilitiesOverdue24215
FormulaResult
=IFERROR(VLOOKUP("Harbour Ltd",G2:H6,2,FALSE),"Not on file")Harbour Ltd is not in the terms table, so the fallback answers.Not on file
=IFERROR(VLOOKUP(B4,G2:H6,2,FALSE),"Not on file")Meridian Freight is on file, so IFERROR does nothing at all and the real answer comes through.45
=IFERROR(E2/D5,"No days to spread over")Row 5 is nought days old, so the division fails and the message answers.No days to spread over
=IFERROR(VLOOKUP(B4,G2:H6,3,FALSE),"Not on file")The supplier is on file and the column number is wrong. IFERROR reports it as not on file, which is the trap.Not on file

Notes

  • IFERROR catches every kind of error, including the ones caused by your own formula. That is exactly why it hides mistakes.
  • A fallback of 0 in an amount column is worse than an error, because a total will accept it without complaint.
Practise IFERROR in Unit 21

A reference tells you what it does. A unit makes you use it.