FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

IFERROR in Google Sheets

In Google Sheets the second argument of IFERROR is optional, and leaving it out returns a blank instead of an error.

In Google Sheets

Excel requires both arguments, so a one-argument IFERROR written in Sheets will not carry over unchanged.

The arguments and common errors are covered in the IFERROR Excel guide; check the function help in Google Sheets for its own argument list.

Worked examples in Google Sheets

Safe division

AB
1RevenueUnits
2100

Formula: D2: =IFERROR(A2/B2,0)

Result: 0

Dividing by zero gives #DIV/0!, which IFERROR replaces with 0.

Friendly lookup failure

AB
1SKUPrice
2A10124.99
3A10239

Formula: D2: =IFERROR(VLOOKUP("Z9",A2:B3,2,FALSE),"Not found")

Result: Not found

Z9 is not in the list, so VLOOKUP returns #N/A and IFERROR shows the text.

Average of an empty range

A
1Notes
2n/a
3pending

Formula: D1: =IFERROR(AVERAGE(B2:B4),"No data")

Result: No data

AVERAGE of cells with no numbers gives #DIV/0!, replaced by "No data".

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =IFERROR(B3/D3,"n/a")

Example spreadsheet for IFERROR
ABCDEF
1StudentScoreExtra creditAttemptsResult
2Ann92Yes2n/a
3Bob74No0
4Cy58Yes3
5Dee81No1
6Eli662
Result in F2: n/a
Practice this in a lesson: IFERROR and Checking Functions

Frequently asked questions

Can I write IFERROR with a single argument in Google Sheets?
Yes. IFERROR(value) returns the value, or a blank when the value is an error. Add the second argument when you want a visible fallback such as 0 or "n/a".

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.