What you will build
Show a readable message when a divisor is zero or missing. This lesson uses fictional sample data so you can reproduce each action.
Learning objective
Complete the steps using the dataset below, explain why the feature or formula is used, and recognize issues when inputs change.
Prepare the sample data
Paste this example as tab-separated values beginning at A1 on a new worksheet:
Practice in your own copy
Make your own Google Sheets copy with the same data, formulas, formatting, filter and frozen header. The original remains unchanged.
Sign in to Google. If the original is not publicly shared, download the full workbook and import it into Google Sheets, or paste the example data into your own sheet.
Open the IFERROR sample workbook in Google Sheets ↗
Work through the example
Step 1: Enter =IFERROR(B2/C2,"Check units") in D2. With Revenue = 120 and Units = 2, D2 must return 60.
Step 2: Inspect the Notebook row where Units = 0. If the formula is copied to that row, the division errors and IFERROR returns Check units.
Formula to try
=IFERROR(B2/C2,"Check units")Checkpoint
| Item | Revenue | Units | Expected result |
|---|---|---|---|
| Pen | 120 | 2 | 60 |
| Notebook | 240 | 0 | Check units |
| Folder | 80 | 1 | 80 |
D2 = 60 was verified live; the remaining rows show the expected result when the same formula pattern is copied down.
Common mistake and correction
If the result is unexpected, inspect the source cells, destination and referenced range in the formula. IFERROR handles any formula error, so using it too broadly can hide broken references. Investigate the underlying cause.
Independent practice
After following the example, complete this variation without editing the source data: Change a zero unit count to a valid number and verify the error message is replaced by a calculated value.
Key takeaways
- ✓Show a readable message when a divisor is zero or missing.
- ✓Create a per-unit metric in D2 using B2/C2.
- ✓IFERROR handles any formula error, so using it too broadly can hide broken references. Investigate the underlying cause.
- ✓Change a zero unit count to a valid number and verify the error message is replaced by a calculated value.
Check your understanding
Answer four questions about the practice sheet.
Continue learning
Previous lesson: IFS function; Next lesson: AND and OR functions.
Comments
No comments yet. Be the first to join the discussion.