# IFERROR formula generator

> Describe what you need and get a IFERROR formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested IFERROR examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/iferror · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

IFERROR returns a value you choose when a formula results in an error, and the formula's normal result otherwise.

Describe the task at [IFERROR formula generator](https://spreadsheetpractice.com/tools/formula-generator/iferror) and get a IFERROR formula for Excel and Google Sheets, tested on real data.

## Tested IFERROR examples

### Replace #DIV/0! with 0 or a blank

`=IFERROR(B2/C2,0)`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/replace-div0-error-with-zero)

### Fix #DIV/0! in a percent change formula

`=IF(B2=0,"New",(C2-B2)/B2)`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/percent-change-div0-error)

### Extract text between two words

`=IFERROR(REGEXEXTRACT(A2,$E$1&" (.+?) "&$G$1),"")`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-text-between-two-words-in-google-sheets)

### Fix #VALUE! when adding cells

`=SUM(B2:D2)`

Excel. Result on the sample sheet: 5 rows (E2:E6). [See it and try it](https://spreadsheetpractice.com/formulas/value-error-when-adding-cells)

### Why does SUMPRODUCT return #VALUE! with text in the range

`=SUMPRODUCT(B2:B7,C2:C7)`

Excel. Result on the sample sheet: $170.90. [See it and try it](https://spreadsheetpractice.com/formulas/sumproduct-value-error)

### Extract a date from text

`=DATEVALUE(REGEXEXTRACT(A2,"\d{1,2}/\d{1,2}/\d{4}"))`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-a-date-from-text-in-google-sheets)

### Extract an email address from text

`=IFERROR(REGEXEXTRACT(A2,"[\w.+-]+@[\w-]+\.[\w.-]*\w"),"")`

Google Sheets. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/extract-an-email-address-from-text-in-google-sheets)

### Sum a range that contains errors

`=SUM(IFERROR(C2:C8,0))`

Excel. Result on the sample sheet: $529.00. [See it and try it](https://spreadsheetpractice.com/formulas/sum-ignoring-errors)

## Questions

### What does the IFERROR formula generator do?

You describe the task in plain English, and it writes the formula, using IFERROR where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does IFERROR do?

IFERROR returns a value you choose when a formula results in an error, and the formula's normal result otherwise.

### Can I learn to write IFERROR formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the IFERROR function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
