Using IFERROR in Google Sheets

Your spreadsheet cells will, from time to time, issue an error; maybe you’ve asked the sheet to do something that doesn’t make sense, or the data you’re using isn’t of the expected format.

Click image to enlarge

Click image to enlarge

Sometimes it’s useful to catch these errors and, instead of showing the raw error message to the user, process the message to change the logical operation of the sheet and/or display something more appropriate for the user to see.

Google Sheets has the function IFERROR to help with this. Here’s the syntax:

IFERROR(value, [value_if_error])

The parameter value is the value you want to be returned if no error is present; if an error is detected, though, the value in the parameter value_if_error will be returned instead.

Click image to enlarge

Click image to enlarge

This second argument is optional. If omitted, a blank value will be returned:

Click image to enlarge

Click image to enlarge