Excel Study · Module 3: Decisions with IF

Class 26IFERROR: no more #DIV/0!

Intermediate1:42 videoFree

Divide by a quantity of zero and Excel shows #DIV/0!. Wrap the formula in IFERROR and you choose what shows instead — here a 0 — while every row that works keeps its normal result. IFERROR also catches #N/A, #VALUE!

Try this AI prompt

Works in ChatGPT, Gemini, Copilot or Claude.

In Excel, B2 has a total cost and C2 a quantity that can be 0. Write a formula for E2 that divides B2 by C2 but shows 0 instead of an error.

The answer that works

✓ checked in Excel
=IFERROR(B2/C2,0)

AI can get Excel wrong. Paste its answer into Excel and test it before you trust it.

Sources: Microsoft support