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 Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Reset SCAN by Another Column in Google Sheets and Excel

Resetting SCAN function results based on values in another column is a topic of...

How to Get the Fastest Time for Each Person in Google Sheets

Whether you’re tracking race results, event times, or any other timed activities, finding the...

Highlight the Smallest N Values in a Column in Google Sheets

Want to visually spotlight the lowest values in your data? In this tutorial, you'll...

Sort Each Row Individually in Excel Using a LAMBDA Formula

Sorting rows in Excel typically refers to rearranging entire datasets based on values in...

More like this

How to Get the Fastest Time for Each Person in Google Sheets

Whether you’re tracking race results, event times, or any other timed activities, finding the...

Highlight the Smallest N Values in a Column in Google Sheets

Want to visually spotlight the lowest values in your data? In this tutorial, you'll...

How to Sort Pie Slices in Google Sheets

To sort pie slices in a pie chart, you need to sort the data...

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.