IFERROR function

2016-04-30

This formula will return a specified value if your given expression results in an error.

 

Syntax

 

IFERROR(Expression, Value if error)

 

  • Expression (required) – This is part of the formula that is checked for an error.
  • Value if error (required) – This is the value that is returned if the expression results in an error (#DIV/0, #N/A, #NAME, #NULL!, #NUM!, #REF!, or #VALUE!).

 

Example

In this example we want to calculate an average cost per use = cost / # of uses (=A2/B2), however some of the # of uses are 0 and this results in a #DIV/0 error.

 

IFERROR-1 IFERROR function

 

We can use the IFERROR function to set the average to 0 when we get a #DIV/0 error by using IFERROR(A2/B2,0).

 

IFERROR-2 IFERROR function

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Subscribe

Advertisement

Related Articles

IFNA function

This function will return a specified value if your given expression results...

read more

TRUE function

This function will return the TRUE value. This is the same as just entering...

read more

FALSE function

This function will return the FALSE value. This is the same as just entering...

read more

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get The Latest News

Follow Us

Follow us on social media to stay up to date with the latest tips in Excel!

Pin It on Pinterest

Share This