In this article, we are going to explore the combination of IF with the ISERROR function in Excel in different circumstances, such as finding unit prices, estimating sales, finding interview times, and determining who is selected or not. To do these, we have used the MATCH, VLOOKUP, CHOOSE, and INDEX-MATCH functions with the IF and ISERROR functions.
Combining the IF and ISERROR functions allows for the creation of robust formulas that handle conditions and errors simultaneously. IF with ISERROR helps us to determine the price of cars, determine target sales and depict interview times of different selected candidates. Moreover, we have extracted the names who are selected or not from a dataset. In the case of determining the unit cost of the car when we divided the gross Cost by 0, we will get an output of On the way, rather than an error. While determining the interview time, we have given the name outside of the dataset, and rather than showing an error, it shows Not Exist. This is how If with ISERROR smoothens the error handling.
What Is ISERROR in Excel?
The ISERROR function in Excel is a logical function that allows users to check if a cell contains an error value. It returns a Boolean value of TRUE if the cell contains any error, such as #VALUE!, #REF!, #DIV/0!, #N/A, #NUM!, or #NAME?. If the cell does not contain an error, the function returns FALSE. The below image demonstrates an overview of the Excel ISERROR function.
The ISERROR function is particularly useful when performing calculations or handling large datasets, as it helps identify and address potential formula errors. By using the ISERROR function in formulas and logical tests, users can create robust error-handling mechanisms and ensure the accuracy and reliability of their spreadsheet data.
IF with ISERROR Function in Excel: 4 Practical Examples
1. Combining IF with ISERROR Function
1.1 Determining Unit Price of Car
- Here we have written the formula below in the E5 cell to find the unit price. When the 0 unit is sold, the cells will show the message “On the way”.
=IF(ISERROR(C5/D5),"On the way",C5/D5)
🔎 Formula Explanation
1.2 Estimating Target Sales of Cars
- We have to write the formula in the D6 cell below to find the estimated sales of cars of a representative. As Bruce has no experience, he will get only Basic Salary.
=IF(ISERROR($D$11*$D$12/C5),$D$11,C5*$D$11)
Here, C5 represents Experience in Years. $D$11 and $D$12 are Primary Sales and Basic Salary respectively. We use the dollar sign ($) in D11 and D12 cells, as we want to use these cells as absolute cell references. So, these won’t be changed if we use the Fill Handle tool.
🔎 Formula Explanation
Read More: Nested IF and ISERROR Formula in Excel
2. Using Combination of Excel IF, ISERROR & MATCH Functions
- Here we have used the formula below in the C13 cells to find out who is qualified or not.
=IF(ISERROR(MATCH(B13, $C$5:$C$9, 0)), "No", "Yes" )
- If name is found, then the output is “Yes”, otherwise “No”.
🔎 Formula Explanation Step 1: MATCH(B13, $C$5:$C$9, 0) Step 2: ISERROR(MATCH(B13, $C$5:$C$9, 0)) Step 3: IF(ISERROR(MATCH(B13, $C$5:$C$9, 0)), “No”, “Yes”)
3. Using a Combination of IF, ISERROR & VLOOKUP Functions
- In this section, we are going to extract the schedule of qualified members’ names from a primary dataset by using the formula below in the C13
=IF(ISERROR(VLOOKUP(B13,$C$5:$D$9,2,FALSE)),"Not Exist",VLOOKUP(B13,$C$5:$D$9,2,FALSE))
🔎 Formula Explanation Step 1: VLOOKUP(B13,$C$5:$D$9,2,FALSE) Step 2: ISERROR(VLOOKUP(B13,$C$5:$D$9,2,FALSE)) Step 3: IF(ISERROR(VLOOKUP(B13,$C$5:$D$9,2,FALSE)),”Not Exist”,VLOOKUP(B13,$C$5:$D$9,2,FALSE))
Another important thing is that you can use the CHOOSE function with the VLOOKUP function to get the similar output. Instead of entering the table_array argument manually, we can apply the CHOOSE function to make an array. The formula is given below,
= IF( ISERROR( VLOOKUP( B13, CHOOSE( {1,2}, $C$5:$C$9, $D$5:$D$9 ), 2, 0) ), “Not present”, VLOOKUP( B13, CHOOSE( {1,2}, $C$5:$C$9, $D$5:$D$9 ), 2, 0) )
The formula CHOOSE({1,2}, $C$5:$C$9, $D$5:$D$9) in Excel is used to select a value from a list based on an index number. In this case, the index numbers are {1,2}, and the lists are located in cells C5:C9 and D5:D9.
The CHOOSE function will return an array of values corresponding to the selected index numbers. In this case, it will return the value from C5:C9 when the index is 1 and the value from D5:D9 when the index is 2.
Here value will be from D5:D9 which is 9:30:00 AM.
Read More: How to Use ISERROR and VLOOKUP Functions in Excel
4. Applying IF & ISERROR Functions with INDEX-MATCH Formula in Excel
- Now, in this section, we are going to track the names scheduled for viva. Here we have used the formula in the C13.
=IF(ISERROR(INDEX($C$5:$C$9, MATCH(B13, $D$5:$D$9, 0))), "Not qualified", INDEX($C$5:$C$9, MATCH(B13, $D$5:$D$9, 0)))
🔎 Formula Explanation Step 1: MATCH(B13, $D$5:$D$9, 0) Step 2: INDEX($C$5:$C$9, MATCH(B13, $D$5:$D$9, 0)) Step 3: ISERROR(INDEX($C$5:$C$9, MATCH(B13, $D$5:$D$9, 0))) Step 4: IF(ISERROR(INDEX($C$5:$C$9, MATCH(B13, $D$5:$D$9, 0))), “Not qualified”, INDEX($C$5:$C$9, MATCH(B13, $D$5:$D$9, 0)))
Things to Remember
- After using the above formula, do not forget to change the data type. In some cases, you need to change the data from General to Time.
- While using the VLOOKUP function, be careful about selecting the table_array Also, put the col_index_num argument vigilantly.
Frequently Asked Questions
1. How can I display a custom message when an error is detected using the nested IF and ISERROR functions?
To display a custom message when an error is detected, you can include a text value or message as the action_if_error parameter within the nested IF and ISERROR functions. For example, you can use =IF(ISERROR(A1), “Error: Invalid value”, A1) to display the custom message “Error: Invalid value” when cell A1 contains an error.
2. Can I use the nested IF and ISERROR functions to handle multiple error conditions?
Yes, you can use the nested IF and ISERROR functions to handle multiple error conditions by nesting multiple IF and ISERROR functions or combining them with other logical functions. By checking for different error types within separate nested IF and ISERROR functions or using logical operators like OR, AND, you can create complex conditions to handle various error scenarios.
Download Practice Workbook
Conclusion
In conclusion, using nested IF functions along with the ISERROR function in Excel gives users a robust error-handling mechanism and flexible conditional logic for complex formulas. By effectively managing errors, users can ensure accurate calculations and maintain the integrity of their data, contributing to the overall effectiveness and usability of their Excel-based workflows.
<< Go Back to Excel ISERROR Function | Excel Functions | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!