IFERROR practice in Google Sheets
IFERROR returns its first argument, or a value of your choice if the first argument is an error. In Google Sheets it works as in Excel and is most often wrapped around a lookup.
- 1Hide #N/A with IFERRORIS is not in the table, so a plain VLOOKUP shows #N/A. In E2, wrap VLOOKUP(D2,A2:B6,2,FALSE) in IFERROR to show "Unknown" instead.
- 2Avoid #DIV/0! with IFERRORPremiumThe lamp has not sold yet, so B2/C2 gives #DIV/0!. In D2, wrap B2/C2 in IFERROR to show 0 instead.
- 3Catch only "not found" with IFNAPremiumE-109 is a new hire who isn't in the list yet. In E2, look up the department for D2 with VLOOKUP and wrap it in IFNA to show "Not listed" instead of #N/A.
Functions in this topic
Questions
Can I leave out the second argument of IFERROR in Google Sheets?
Yes. Google Sheets then shows an empty cell instead of the error. Writing "" as the second argument gives the same result and works in Excel too.