How to Use the IFNA Function in Google Sheets

Published on

The IFNA function in Google Sheets helps you handle #N/A errors effectively. It evaluates a value or expression, and if it results in an #N/A error, it replaces it with a specified custom value instead.

The IFNA function is particularly useful when working with lookup functions like VLOOKUP, HLOOKUP, MATCH, or XMATCH. Often, when a lookup function cannot find a match, it returns an #N/A error. Instead of displaying the error, you can use IFNA to return a clearer message or a blank cell, helping users understand that the lookup value was simply not found.

However, keep in mind that not all #N/A errors mean “not available.” Some functions return #N/A if the number of required or specified arguments is incorrect. So, before using IFNA to replace an error, make sure the formula itself is correctly written and the #N/A truly means the data is missing.

IFNA Function Syntax and Arguments

Syntax:

IFNA(value, value_if_na)

Arguments:

  • value – The value or expression to evaluate for an #N/A error.
  • value_if_na – The value to return if the first argument results in an #N/A error.

You can use the IFNA function with many functions in Google Sheets, especially lookup-related ones. Here’s a quick reference:

FunctionWhen It Returns #N/A
VLOOKUPWhen the lookup value is not found in the first column of the range.
HLOOKUPWhen the lookup value is not found in the first row of the range.
MATCHIf the lookup value is not found within the specified range.
XMATCHIf the lookup value is not found in the array or range.
XLOOKUPIf the lookup value is not found and no if_not_found argument is provided.
LOOKUPIf the search value is smaller than the smallest value in the array/range (in certain cases).
FILTERWhen no rows meet the filter criteria.
SWITCHWhen the expression does not match any of the provided cases.
IFSWhen none of the conditions evaluate as TRUE.

Using IFNA with these functions ensures that your spreadsheet looks clean and users understand that a result was simply not available, rather than seeing confusing error messages.

IFNA Function Examples

Imagine you have student names in column A and their marks in column B.

Here’s a basic VLOOKUP formula that might return an #N/A error if the student name isn’t found:

=VLOOKUP("Tom", A1:B10, 2, FALSE)

If “Tom” isn’t listed in column A, this formula returns #N/A.

Instead, use IFNA to handle the error:

Example 1: Return a blank if not found:

=IFNA(VLOOKUP("Tom", A1:B10, 2, FALSE))

Example 2: Return a custom message:

=IFNA(VLOOKUP("Tom", A1:B10, 2, FALSE), "Name not found!")

These formulas ensure your sheet stays clean and user-friendly, replacing the #N/A error with either an empty cell or a clear message like “Name not found!”.

Resources You May Find Helpful

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Google Sheets: Get the Last Row with Any Data Across Multiple Columns

It’s common to have several empty rows at the bottom of a Google Sheet,...

How to Calculate Digital Root in Google Sheets

The digital root is the single-digit value you get by repeatedly summing the digits...

How to Build an Advanced Book Tracker in Google Sheets: Formulas Explained

If you're tired of forgetting what you've read, which books you rated 5 stars,...

Google Sheets Reading List Tracker Template (Free Download)

Looking for a smarter, more visual way to manage your reading goals? This Google...

More like this

Google Sheets: Get the Last Row with Any Data Across Multiple Columns

It’s common to have several empty rows at the bottom of a Google Sheet,...

How to Calculate Digital Root in Google Sheets

The digital root is the single-digit value you get by repeatedly summing the digits...

How to Build an Advanced Book Tracker in Google Sheets: Formulas Explained

If you're tired of forgetting what you've read, which books you rated 5 stars,...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.