Handling Errors
Part of the Formulas and Data Analysis section of Coddy's Excel journey. Lesson 9 of 28.
IFERROR(value, fallback) returns the calculated value when it succeeds and a fallback when it produces an error. It does not replace valid zero results. A fallback should communicate the missing or invalid calculation rather than hide a mistake.
B2 contains 24, C2 contains 0.
Example: =IFERROR(B2/C2,"No units").
Division by zero produces an error, so IFERROR returns the specified text.
Use IFERROR around the expression that may fail, and choose a meaningful fallback.
The practice sheet highlights cells where you should enter formulas. The same formulas must work when the tests replace the input data.
Challenge
EasyTotal cost is in B2 and units in C2. In D2, calculate cost per unit; if the calculation errors, return the exact text No units. Units may be zero.
Enter formulas in the highlighted output cells: D2. Keep the supplied data and headings. Tests change input values, so use cell references instead of typing the sample answers. Use English function names and commas between arguments.
Try it yourself
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Batch | Cost | Units | Unit cost | |||
| 2 | A | 60 | 3 | ||||
| 3 | |||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 | |||||||
| 8 | |||||||
| 9 | |||||||
| 10 | |||||||
| 11 | |||||||
| 12 | |||||||
| 13 | |||||||
| 14 |
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Formulas and Data Analysis
Practice on your own: Excel playground