## Excel Office

Excel How Tos, Tutorials, Tips & Tricks, Shortcuts

# Tag: IFERROR function

## IFERROR function: Description, Usage, Syntax, Examples and Explanation

What is IFERROR function in Excel? IFERROR function is one of the Logical functions in Microsoft Excel that 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 in a formula. Syntax of IFERROR function IFERROR(value, value_if_error) The IFERROR function syntax has the…

## Basic error trapping example in Excel

To catch errors that a formula might trigger in a worksheet, you can use the IFERROR function to display a custom message, or nothing at all. See example below: Formula =IFERROR(formula,value_if_error) Explanation In the example shown, the formula in E5 is: =IFERROR(C5/D5,””) How this formula works In this example, the IFERROR function is used to trap and suppress the #DIV/0!…

## How to strip non-numeric characters in Excel

To remove non-numeric characters from a text string, you can try this experimental formula based on the TEXTJOIN function, new in Excel 2016. Formula {=TEXTJOIN(“”,TRUE,IFERROR(MID(A1,ROW (INDIRECT(“1:100″)),1)+0,””))} Note: TEXTJOIN will return the numbers as text, for example “100,”500″, etc. If you want a true numeric result, add zero, or wrap the entire formula in the VALUE function. TEXTJOIN was added in Excel 2016 + Office…

## Create dynamic workbook reference to another workbook in Excel

To build a dynamic worksheet reference – a reference to another workbook that is created with a formula based on variables that may change – you can use a formula based on the INDIRECT function. See example below: Formula =INDIRECT(“‘[“&workbook&”]”&sheet&”‘!”&ref) Explanation In the example shown, the formula in E6 is: =INDIRECT(“‘[“&B6&”]”&C6&”‘!”&D6) How this formula works The gist of this formula…

## How to get first word in Excel

If you need to extract the first word from some text you can use a formula that uses the FIND and LEFT functions. Formula =LEFT(a1,FIND(” “,a1)-1) Explanation From the example, the formula looks like this: =LEFT(B4,FIND(” “,B4)-1) How this formula works FIND returns the position (as a number) of the first occurrence of a space character in the text. This position, minus…

## How to calculate next scheduled event in Excel

To get the next scheduled event from a list of events with dates, you can use an array formula based on the MIN and TODAY functions to find the next date, and INDEX and MATCH  to display the event on that date. Formula {=MIN(IF((range>=TODAY()),range))} Note: this is an array formula and must be entered with Control + Shift + Enter. Explanation In…

## VLOOKUP without #N/A error in Excel

This tutorial shows how to calculate VLOOKUP without #N/A error in Excel using the example below; Formula =IFERROR(VLOOKUP(value,table,2,FALSE),””) Explanation To hide the #N/A error that VLOOKUP throws when it can’t find a value, you can use the IFERROR function to catch the error and return any value you like. How the formula works When VLOOKUP can’t find a value in…

## Multiple chained VLOOKUPs in Excel

This tutorial shows how to  work  Multiple chained VLOOKUPs in Excel using the example below; Formula =IFERROR(VLOOKUP 1,IFERROR(VLOOKUP 2,VLOOKUP 3)) Explanation If you need to perform multiple lookups sequentially, based on whether the earlier lookups succeed or not, you can chain one or more VLOOKUPs together with IFERROR. In the example shown, the formula in L5 is: =IFERROR(VLOOKUP(K5,B5:C7,2,0),IFERROR(VLOOKUP(K5,E5:F7,2,0),VLOOKUP(K5,H5:I7,2,0))) How this formula…

## Extract multiple matches into separate rows in Excel

This tutorial shows how to calculate Extract multiple matches into separate rows in Excel using the example below; Explanation To extract multiple matches to separate cells, in separate rows, you can use an array formula based on INDEX and SMALL. In the example shown, the formula in E5 is: {=IFERROR(INDEX(names,SMALL (IF(groups=E\$4,ROW(names)-MIN(ROW (names))+1),ROWS(\$E\$5:E5))),””)} This is an array formula and must be…

## Extract multiple matches into separate columns in Excel

This tutorial shows how to Extract multiple matches into separate columns in Excel using the example below; Explanation To extract multiple matches to separate cells, in separate columns, you can use an array formula based on INDEX and SMALL. In the example shown, the formula in F5 is: {=IFERROR(INDEX(names,SMALL(IF(groups=\$E5,ROW(names)-MIN(ROW(names))+1),COLUMNS(\$E\$5:E5))),””)} This is an array formula and must be entered with Control…

## nth smallest value with criteria in Excel

This tutorial shows how to calculate nth smallest value with criteria in Excel using the example below; To get the 2nd smallest value, 3rd smallest value, 4th smallest value, and so on, where each value matches supplied criteria, you can use an array formula that uses the SMALL and IF functions. Formula {=SMALL(IF(criteria,values),n)} Explanation In the example shown, the formula…

## Sum top n values with criteria in Excel

This tutorial shows how to Sum top n values with criteria in Excel using the example below; Formula =SUMPRODUCT(LARGE((range=criteria)*(values),{1,2,3,N})) Explanation To sum the top n values in a range matching criteria, you can use a formula based on the LARGE function, wrapped inside the SUMPRODUCT function. In the generic form of the formula (above), range represents a range of cells that are compared to criteria,…

## How to return blank in place of #DIV/0! error in Excel

This example illustrates the IFERROR function and how to return blank in place of #DIV/0! error in Excel. 1. For example, Excel displays the #DIV/0! error when a formula tries to divide a number by 0. 2. Use the IFERROR function. If a cell contains an error, an empty string (“”) is displayed.

## How to Sum Range with Errors in Excel

This example shows you how to create an array formula that sums a range with errors. You can also use the AGGREGATE function to sum a range with errors. 1. We use the IFERROR function to check for an error. Explanation: the IFERROR function returns 0, if an error is found. If not, it returns the value of the cell. 2. To sum the range…