top of page

Taming the Wild Error Messages: The IFERROR Formula

savvyanalytiqs

Last week, while reviewing a client's spreadsheet, I noticed they had created an elaborate formula to avoid Excel's error messages. The IFERROR formula could have solved that for them in a much more elegant way. While it might not be the most exciting Excel trick, I use this versatile function in every project I work on.


Error messages like N/A, DIV/0!, and REF! can make your spreadsheets look messy and unprofessional; IFERROR lets you replace them with whatever you choose: a blank cell, zero, custom message, or even another calculation. Just remember to use it thoughtfully to avoid masking genuine errors that need attention.


Formula Basics

·       The calculation is simple: =IFERROR(original_formula, value_if_error ) 

·       original_formula is your calculation

·       value_if_error is what you want to show if there is in an error


Real-World Applications


  1. Replacing an error with a blank or a custom message: You are calculating internal hire rates (Internal Hires/Total Hires) for your Q1 scorecard. When a department has zero hires, you get the DIV/0! error. Here’s the fix:


Original formula:

=A2/B2  


For a blank cell:

=IFERROR(A2/B2, “”)  


For a custom message: 

=IFERROR(A2/B2, “No hires in this department”) 


  1. Replacing errors with a 0: You want to know the total number of PTO days taken by department, so you create a pivot table from a PTO report. When you pull the data into your dashboard, if a department hasn’t taken any PTO, you will get an error message instead of it showing zero days. Here’s the fix:


Original formula:

= VLOOKUP(A2,A:B,2,FALSE)


For a zero:

= IFERROR(VLOOKUP(A2,A:B,2,FALSE),0)


  1. Replacing errors with a new formula: Here's a more advanced scenario: You're merging data from your ATS and HRIS systems. Without a common employee ID, you need to match records using either email addresses or a combination of name and hire date. IFERROR lets you try both approaches:


Original formula (email only):

=VLOOKUP(A2,EmailColumn,2,false) 


Enhanced formula (tries email, then tries name + date): 

=IFERROR(VLOOKUP (A2, Email,2,false), VLOOKUP (A2,NameDate,2,false) )


Final Thoughts

The beauty of IFERROR lies in its simplicity – it's one of those formulas that, once you start using it, you'll wonder how you lived without it. While it might not be as flashy as some Excel functions, it's like having a great organizing system: it keeps things clean, professional, and easy to understand.


Just remember: the goal isn't to hide errors, but to present data in a way that makes sense to your audience. Whether you're creating executive dashboards or managing day-to-day HR reports, IFERROR can help you deliver polished, professional results.


What Excel errors have been giving you headaches? Try IFERROR and let me know how it transforms your spreadsheets.


PS - Want to take it a step further? Look into IFNA, which gives you more precise control by specifically handling N/A errors while letting other error types show normally.

 
 
 

Comments


bottom of page