๐ Excel Basics #18 โ IFERROR() Function
The IFERROR() function helps you handle errors gracefully by displaying a custom message or value instead of Excel error codes. It's one of the most useful functions for creating professional reports and dashboards.
๐ What is the IFERROR() Function?
The IFERROR() function checks whether a formula returns an error.
โข If no error occurs, it returns the formula's result.
โข If an error occurs, it returns the value you specify.
Syntax:
=IFERROR(value, value_if_error)
๐ Example 1 โ Avoid Division by Zero
Without IFERROR():
=A2/B2
If B2 = 0, Excel returns: #DIV/0!
With IFERROR():
=IFERROR(A2/B2,"Cannot Divide")
Result:
โข If B2 = 10 โ Returns the calculated value.
โข If B2 = 0 โ Returns "Cannot Divide".
๐ Example 2 โ Return 0 Instead of an Error
=IFERROR(A2/B2,0)
If an error occurs, Excel returns 0 instead of an error message.
๐ Example 3 โ Handle Lookup Errors
=IFERROR(VLOOKUP(E2,A2:C10,3,FALSE),"Not Found")
If the value isn't found, Excel displays "Not Found" instead of #N/A.
๐ Common Excel Errors
โข #DIV/0! โ Division by zero.
โข #N/A โ Value not found.
โข #VALUE! โ Incorrect data type.
โข #REF! โ Invalid cell reference.
โข #NAME? โ Misspelled function or name.
โข #NUM! โ Invalid numeric value.
โข #NULL! โ Incorrect range reference.
๐ Real-World Uses
โ
Display "Not Available" for missing data
โ
Prevent lookup formulas from showing errors
โ
Build clean dashboards without error messages
โ
Improve the appearance of reports shared with stakeholders
๐ Common Mistakes
โ Using IFERROR() to hide errors without fixing the root cause
โ Returning misleading values that make debugging difficult
โ Wrapping every formula unnecessarily
โ
Best Practices
โ
Use IFERROR() only when errors are expected
โ
Choose meaningful replacement values like "Not Found" or "No Data" instead of leaving users confused.
โ
Fix the underlying issue whenever possible rather than simply hiding the error.
โ
Combine IFERROR() with lookup functions like VLOOKUP(), XLOOKUP(), and INDEX()/MATCH() for professional spreadsheets.
The IFERROR() function makes your Excel workbooks cleaner, easier to understand, and more user-friendly.
Double Tap โค๏ธ For More
Post #2235
3.2K
- โค 14