SheetsLessons
Logical function

IFNA function in Google Sheets

IFNA catches only the #N/A error, the one lookups return when a value isn't found. Every other error still shows, so real mistakes don't get hidden.

Syntax

=IFNA(value, value_if_na)
value
The formula to try (usually a lookup).
value_if_na
What to show if the result is #N/A.

Practice IFNA

Task 1 of 1

Look up the price for the SKU in D2. If the SKU isn't listed, show "Not listed", but use IFNA so that any other kind of error still shows up. Answer in E2.

E2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

IFNA examples

Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.

ABCDE
1Emp IDNameDeptEmailSalary
21042Maya PatelFinancemaya.patel@acme.co$72,000.00
31187Leo RossiSupportleo.rossi@acme.co$51,000.00
41305Ava KimSalesava.kim@acme.co$64,000.00
51411Omar AliMarketingomar.ali@acme.co$58,000.00
61520Hana TanakaSaleshana.tanaka@acme.co$69,000.00
Employee directory
FormulaResultWhat it shows
=IFNA(VLOOKUP(9999, A2:B6, 2, FALSE), "No match")No matchNot found becomes "No match".
=IFNA(MATCH("Sales", C2:C6, 0), 0)3Found at position 3, so the normal result comes through.
=IFNA(1/0, "x")#DIV/0!#DIV/0! isn't #N/A, so it is not caught.

Tips and common mistakes

  • XLOOKUP has a built-in missing_value argument, so you don't need IFNA around it.

Related functions