Show a clean result instead of an error with IFERROR
Replace #DIV/0!, #N/A, and other errors with 0, a blank, or a short message, and learn when hiding an error is a bad idea.
FormulasBeginner7 minExcel · Google Sheets
Example content. The numbers are fictional and made for learning.
Goal
Work out the price per unit for each product, and show 0 for a product that has not sold yet instead of #DIV/0!.
Why this is useful
One error spreads: every total that uses that cell shows the error too. IFERROR stops it at the source, so reports stay readable while some data is still missing.
Example
| Row | A | B | C |
|---|---|---|---|
| 1 | Product | Revenue | Units |
| 2 | Mugs | 480 | 40 |
| 3 | Prints | 0 | 0 |
| 4 | Tote bags | 360 | 12 |
| 5 | Price per unit, Prints | 0.00=IFERROR(B3/C3,0) |
Steps
1. Write the formula as usual
Revenue divided by units: =B2/C2. It works until a row has 0 units, which gives #DIV/0!.
2. Wrap it in IFERROR
Put the formula inside IFERROR and add what to show instead: =IFERROR(B2/C2,0). Swedish uses OMFEL.
3. Choose a blank or a message
Use "" for an empty-looking cell, or a word such as "Not found" after a lookup. Use 0 when the cell is added up later, because SUM skips text.
4. Prefer a specific check when you can
For division, =IF(C2=0,0,B2/C2) only catches a zero divisor. IFERROR catches every error, including typing mistakes you would want to see.
5. Test with a real error
Clear a cell the formula uses and check that the fallback appears; then put the value back and check the normal result returns.
Formulas by language
Cell names such as B2 stay the same. The function name and the character between arguments follow the spreadsheet language. The English line in each list is the reference form used on this site, not a universal spelling. When the decimal sign is a comma, arguments are usually separated with a semicolon, because the comma is already used in numbers.
12.00 for Mugs; 0 for Prints instead of #DIV/0!.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=IFERROR(B2/C2,0)Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=OMFEL(B2/C2;0)German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=WENNFEHLER(B2/C2;0)French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SIERREUR(B2/C2;0)Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SI.ERROR(B2/C2;0)Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SI.ERROR(B2/C2,0)Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SEERRO(B2/C2;0)Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SE.ERRORE(B2/C2;0)Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=ALS.FOUT(B2/C2;0)
A blank instead of the error.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=IFERROR(B2/C2,"")Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=OMFEL(B2/C2;"")German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=WENNFEHLER(B2/C2;"")French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SIERREUR(B2/C2;"")Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SI.ERROR(B2/C2;"")Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SI.ERROR(B2/C2,"")Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SEERRO(B2/C2;"")Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SE.ERRORE(B2/C2;"")Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=ALS.FOUT(B2/C2;"")
A message when a lookup finds nothing.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=IFERROR(VLOOKUP(E2,A2:C10,3,FALSE),"Not found")Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=OMFEL(LETARAD(E2;A2:C10;3;FALSKT);"Not found")German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=WENNFEHLER(SVERWEIS(E2;A2:C10;3;FALSCH);"Not found")French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SIERREUR(RECHERCHEV(E2;A2:C10;3;FAUX);"Not found")Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SI.ERROR(BUSCARV(E2;A2:C10;3;FALSO);"Not found")Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SI.ERROR(BUSCARV(E2,A2:C10,3,FALSO),"Not found")Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SEERRO(PROCV(E2;A2:C10;3;FALSO);"Not found")Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SE.ERRORE(CERCA.VERT(E2;A2:C10;3;FALSO);"Not found")Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=ALS.FOUT(VERT.ZOEKEN(E2;A2:C10;3;ONWAAR);"Not found")
Catches only division by zero, so other mistakes stay visible.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=IF(C2=0,0,B2/C2)Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=OM(C2=0;0;B2/C2)German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=WENN(C2=0;0;B2/C2)French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SI(C2=0;0;B2/C2)Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SI(C2=0;0;B2/C2)Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SI(C2=0,0,B2/C2)Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SE(C2=0;0;B2/C2)Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SE(C2=0;0;B2/C2)Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=ALS(C2=0;0;B2/C2)
The same spoken language can use different separators in different countries. Spanish in Spain often uses a comma for decimals and a semicolon between arguments. Spanish in Mexico often uses a period and a comma. If a formula is rejected, check the spreadsheet locale.
Excel and Google Sheets
- IFERROR works in Excel 2007 and later and in Google Sheets.
- IFERROR hides every kind of error, including #NAME? from a misspelled function and #REF! from a deleted cell. Check the formula works before you wrap it.
- Function names and the separator between arguments follow the spreadsheet language. Excel uses the language of your installation; Google Sheets uses the spreadsheet locale under File, Settings.
- Workbooks from Hellosheetwise store formulas in English. Excel and Google Sheets show them in your language when you open the file.
If something goes wrong
The cell shows the fallback even when the data is fine.
The inner formula has a mistake of its own. Remove IFERROR for a moment to see the real error.
A total ignores the cells with the fallback.
A text fallback such as "" or "Not found" is skipped by SUM. Use 0 when the cell must count in totals.
The formula is rejected.
IFERROR needs two arguments: the formula and the value to show. Check the brackets close after the second one.