Cellgrids Cellgrids
Home › Practice questions › IFERROR › Question 1

Excel IFERROR Practice Question: Divide the sales by the units for each row, but show 0 when the units are 0.…

By Rinkesh Shah, founder of Cellgrids.

The question

Divide the sales by the units for each row, but show 0 when the units are 0. Put it in C2 to C4.

The data

ABC
1SalesUnitsPer unit
21004?
3500?
4903?

The yellow cells are where your answer goes.

Show answer

Expected results:

  • C2 = 25
  • C3 = 0
  • C4 = 30

How it works

Explanation: Dividing by 0 gives the #DIV/0! error. IFERROR replaces any error with the value you choose.
Syntax: =IFERROR(A2/B2,0)
100/4 gives 25. 50/0 is an error, so 0. 90/3 gives 30.

Try it yourself in the live sheet

Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.

Try this question in the live sheet →

IFERROR syntax

=IFERROR(value, value_if_error)

Runs a formula, but shows a fallback value instead of an error if it fails. IFERROR is used to build decision rules directly into a spreadsheet instead of manually judging each row. Full IFERROR guide.

More IFERROR practice questions

All practice questions · Excel exercises · Interview prep · Cheat sheet