IFERROR Excel Formula – What is it, syntax, examples and howto

Share

Facebook
Twitter
LinkedIn

IFERROR Excel Formula - What is it, syntax, examples and howtoIf IFERROR() were to be a person, I would hug her so hard that Jo (my wife) would get in to a cat fight with her. I know many a woman (and man) who get in to a fight with Excel formulas often. But thankfully, we avoid that as IFERROR is not a real person. It is, however a darned useful formula.

Since I cannot hug a formula anymore than I can get my son to sit tight, I will go ahead and sing an ode to her, in my style – by writing about how useful and powerful IFERROR formula is.

What is IFERROR() Formula & How does it work?

Introduced since Excel 2007, IFERROR() formula checks a formula (or expression) and returns the value of formula if there is no error, otherwise a custom formula.

IFERROR Excel Formula - What is it, syntax, examples and howto - Chandoo.org
For eg:

=IFERROR(1/0,"Try splitting an atom instead!")

will give the message Try splitting an atom instead! because the expression 1/0 returns an error (DIV/0 error)

Where as,

=IFERROR(0/1,"Try splitting an atom instead!")

will give the value 0 since 0 divided by 1 is 0.

How does IFERROR help me?

Archimedes once said, “Give me enough data and a spreadsheet, I can make any formula return an error.”

May be he was too confident, but errors are everywhere. And that is why IFERROR is useful. It provides an elegant and simple way to tackle the errors in your workbook.

Several common uses of IFERROR are,

  1. 1. While writing lookup formulas like VLOOKUP, INDEX+MATCH it is common to search for values that do not exist in your data. You can wrap such formulas in IFERROR for peace of mind.
    Ex: =IFERROR(VLOOKUP(...),"Not found")
  2. 2. While using reference formulas like INDEX, OFFSET, frequently, we try to fetch the data that is not in the list of values. This returns #REF errors. You can fix them with IFERROR easily.
    Ex: =IFERROR(INDEX(...),"")
  3. 3. While using arithmetic, numeric expressions, usually we end up dividing by 0. You can fix such things by using IFERROR.
    Ex: =IFERROR(AVERAGE(...),"0") — Returns 0 when the list has zero values.

Things to keep in mind while IFERRORing:

Please note that IFERROR is oblivious to the type of error. That means, no matter what the error is (DIV/0, #NAME, #N/A, #REF… etc.), IFERROR treats all of them equally and shows the same value. In other words, IFERROR is like “Catch all” in programming world.

How to handle errors if you are using Excel 2003 or below?

In earlier versions of Excel, we have a formula called as ISERROR() that can check an expression or formula for error and return TRUE if so. This formula is not same as IFERROR, but we can use it along with IF() formula to get the same result. For eg.

=IF(ISERROR(VLOOKUP(...)),"Not found",VLOOKUP(...))

works same as, =IFERROR(VLOOKUP(...),"Not found")

Notice that the ISERROR approach evaluates VLOOKUP formula twice!.

Do you IFERROR?

To err is human, to IFERROR is awesome.

Ever since discovering the IFERROR feature in Excel 2007, I have been using it so often. I use it to keep my output sheets clean and my formulas simple.

What about you? Do you use IFERROR? What is your experience like? Would you also give it a hug? If so, would your spouse get in to a cat fight with it? If so can you post some pics of it on our facebook page?

Please share your experiences and tips on using IFERROR() thru comments.

Related awesomeness:

1. How to understand and handle Excel formula errors
2. Excel formulas not working? What to do?
3. Handling errors and 5 other tips for writing better VLOOKUP formulas

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

5 Responses to “Show more of your workbook on screens [quick tip]”

  1. Bda75 says:

    In 2013 you can also add to the QAT the hidden command "Toggle Full Screen View".

  2. Chris Newman says:

    Instead of using the shortcut CTRL+F1, I prefer just to double-click one of the tab names (ie double-click the "Home" text on the Home tab) to enable the Ribbon Outline view. To return to the normal Ribbon state, just double-click your mouse again!

  3. liu says:

    press Ctrl+Shift+F1, you will get a full screen

  4. efand says:

    Instead of Ctrl + F1, I use Ctrl + Shift + F1 (Excel 2016)

  5. Jay says:

    Alt W E sequence for full screen
    ESC to get back

Leave a Reply