Excel IFERROR Practice Question: The values are typed as text. Turn each into a number, and show 0 if it is not…
The question
The values are typed as text. Turn each into a number, and show 0 if it is not a number. Put it in B2 to B4.
The data
| A | B | |
|---|---|---|
| 1 | Text | Number |
| 2 | 100 | ? |
| 3 | abc | ? |
| 4 | 45 | ? |
The yellow cells are where your answer goes.
Show answer
Expected results:
- B2 = 100
- B3 = 0
- B4 = 45
How it works
Explanation: VALUE gives #VALUE! for text that is not a number. IFERROR turns that error into 0.
Syntax: =IFERROR(VALUE(A2),0)
100 becomes 100. abc is an error, so 0. 45 becomes 45.
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
- Divide the sales by the units for each row, but show 0 when the units are 0. Put it in…
- Look up the price of each item in the table (D2:E4). Show Not found if the item is not…
- Find the growth (this year minus last year, divided by last year). Show New when last…
- Find the average of the three marks in B to D for each student. Show No marks when the…
- Look in list 1 (C2:D3) first, then in list 2 (E2:F3), and show Not found if the code is…
- Divide each sales figure in column A by the units in column B, treat the errors as 0,…
- Each note may contain a reference like #101. Take the number after the # sign, or show…
- Product IDs to price are in A2:A7 and the price list is in D2:E6. Show the price in…
All practice questions · Excel exercises · Interview prep · Cheat sheet