IFERROR function

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




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!).



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.




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).



About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and qualified actuary with over 15 years of experience. He has worked in a variety of industries, including insurance, ad tech, and most recently Power Platform consulting. He is a keen problem solver and has a passion for using technology to make businesses more efficient.


Subscribe for awesome Microsoft Excel videos 😃

Related Posts



Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃