---
title: "IFERROR function in Excel"  
description: "IFERROR function in Excel"  
author: "AVADHESH PATEL"  
published: 2013-03-26  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/1168/iferror-function-in-excel  
category: "excel"  
tags: ["excel"]  
reading_time: 2 minutes  

---

# IFERROR function in Excel

In [Excel sheet](https://www.mindstick.com/forum/23040/to-import-excel-sheet-into-sql-database), if we want to display [custom error](https://www.mindstick.com/forum/158277/how-to-apply-custom-error-messages-for-form-validation-errors-using-the-setcustomvalidity-method) when we apply [formula](https://yourviews.mindstick.com/view/81488/usa-needs-masks-for-all-formula-in-corona-pandemic) into cells. IFERROR [function](https://www.mindstick.com/articles/43970/purchase-suitable-wedding-dresses-for-your-wedding-function) returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula. Use the IFERROR function to trap and [handle errors](https://www.mindstick.com/forum/159698/how-to-handle-errors-and-exceptions-in-a-dot-net-core-api) in a formula.\

##### Syntax:

IFERROR(value,value_if_error)

##### Note:

· Value is the argument that is checked for an error.

· **Value_if_error** is the value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.

· If value or **value_if_error** is an empty cell, IFERROR treats it as an empty [string value](https://www.mindstick.com/forum/23050/how-to-convert-string-value-to-hexa-value-in-vb-dot-net) ("").

· If value is an array formula, IFERROR returns an array of [results](https://yourviews.mindstick.com/view/88282/boost-your-career-mindstick-technical-training-that-delivers-results) for each cell in the range specified in value. See the second example below.

##### Example:

![IFERROR function in Excel](https://www.mindstick.com/mindstickarticle/aaa910aa-8807-4088-929c-d6297737d868/images/d2ebf5b9-f94d-4f22-b929-4eee2605f610.png)

From the above image, I’m going to calculate per unit cost, if value is calculated successfully then it return value otherwise it return error message. See below example.

=IFERROR(B3/C3,”Error in calculation”)

![IFERROR function in Excel](https://www.mindstick.com/mindstickarticle/aaa910aa-8807-4088-929c-d6297737d868/images/47bdf98e-1054-4884-97a9-e0b747525818.png)

##### Note:

When we apply formula on row 3-9 for calculating per unit cost, all [return value](https://www.mindstick.com/forum/33675/how-to-convert-return-value-of-abmulivaluecopylabelatindex-into-nsstring-in-ios) but row 8 return custom [error message](https://www.mindstick.com/forum/23174/error-message-the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration) because value not divided by 0 (zero).

\

---

Original Source: https://www.mindstick.com/articles/1168/iferror-function-in-excel

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
