Unit prices that survive bad data (IFERROR)
An order's unit price is Total divided by Qty — until someone types 0 as the quantity and every division in the report turns into #DIV/0!. Build the safe version in Unit price cell D2: show the normal price when the math works, and the text "Check qty" when the division blows up.
Your solution should use cell references so it updates automatically when Test Case input values change.
Notes
#DIV/0! means "you asked me to divide by zero or by an empty cell". IFERROR(value, fallback) returns the fallback only when value produces an error. Note the asymmetry in Case 3: a total of 0 is a perfectly valid number (0 ÷ 5 = 0) — IFERROR leaves it alone. IFERROR catches every error type, so if you only want to trap zero quantities, the IF-check approach is the more surgical tool.
Function guide
FAQ
What causes #DIV/0! in Excel?
Dividing by zero or by an empty cell: =C2/B2 errors when B2 is 0 or blank. Fix the data, or wrap the division in =IFERROR(C2/B2, "fallback") to show something useful instead.
How do I hide #DIV/0! errors in a report?
=IFERROR(C2/B2, "") returns an empty-looking cell, or use a real message like "Check qty". A visible message is usually better — silent blanks hide data problems from the people who should fix them.
Is IF(B2=0,…) better than IFERROR?
When zero is the only realistic problem, the IF check is more precise: it converts exactly that case and still surfaces #REF! or #VALUE! loudly. IFERROR converts every error, which is convenient but can mask structural breakage.