Wrapping it in IFERROR(…,0) makes the error disappear but turns “we have none” into “it costs nothing”. Test for the case you expect instead, =IF(C3=0,"no stock",B3/C3), and let other errors stay visible.
See it happen
D3=B3/C3| A | B | C | D | |
|---|---|---|---|---|
| 1 | SKU | Stock value | Units | Cost per unit |
| 2 | TP-110 | 250 | 100 | 2.5 |
| 3 | BX-204 | 375 | 0 | #DIV/0! |
| 4 | GL-318 | 500 | #DIV/0! |
Three ways to handle it
| Formula | BX-204 shows | What it tells the reader |
|---|---|---|
=IFERROR(B3/C3,0) | 0 | That the item costs nothing. Wrong |
=IF(C3=0,"no stock",B3/C3) | no stock | The truth for a sold-out item |
=IF(C3="","not counted",IF(C3=0,"no stock",B3/C3)) | no stock (filled down, GL-318 shows “not counted”) | Separates “we have none” from “nobody counted” |
An empty cell counts as zero in a comparison: filled down to row 4, =IF(C4=0,…) is true for GL-318 too. Test for the empty cell first if the difference matters.
Why not IFERROR?
Our view, not a rule from research: IFERROR catches every error, not only the one you expected. If a column is deleted or a lookup misses, IFERROR(…,0) turns those into zeros too, and the total below them still looks fine. A formula that names the case it expects keeps every other mistake visible. IFERROR is fine when you have checked that the only possible error is the one you mean.
The same idea applies to lookups: see VLOOKUP returns #N/A.
What Ghost Sheet doesn’t do
It does not scan your workbook for hidden errors. Its tasks run your formula on later data where the zero or the blank arrives, so you see what your choice does.
How we checked
We ran the formulas on this page on the example data in the formula engine Ghost Sheet uses (Univer) on November 24, 2026, except where the page says we could not, and the sheets show the values it returned. That engine is not Microsoft Excel, and we have not re-run these examples in desktop Excel. One known difference: where Excel shows TRUE or FALSE, our engine shows 1 or 0.
Updated