Monday, November 20, 2017

IFNA function

IFNA function

This article describes the formula syntax and usage of the IFNA function in Microsoft Excel.

Description

Returns the value you specify if the formula returns the #N/A error value; otherwise returns the result of the formula.

Syntax

IFNA(value, value_if_na)

The IFNA function syntax has the following arguments.

  • Value    Required. The argument that is checked for the #N/A error value.

  • Value_if_na    Required. The value to return if the formula evaluates to the #N/A error value.

Remarks

  • If Value or Value_if_na is an empty cell, IFNA treats it as an empty string value ("").

  • If Value is an array formula, IFNA returns an array of results for each cell in the range specified in value.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Formula

Description

Result

=IFNA(VLOOKUP("Seattle",$A$5:$B$10,0),"Not found")

IFNA tests the result of the VLOOKUP function. Because Seattle is not found in the lookup range, VLOOKUP returns the #N/A error value. IFNA returns the string "Not found" in the cell instead of the standard #N/A error value.

Not found

Region ID

City

Atlanta

105

Portland

142

Chicago

175

Los Angeles

251

Boise

266

Cleveland

275

Top of Page

No comments:

Post a Comment