IFNA(value, value_if_na)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
value:
The value or expression that you want to check for an error (specifically, #N/A).
value_if_na:
The value to return if the value results in an #N/A error.
The IFNA function in Google Sheets is a useful tool that allows you to handle errors that may arise from other functions, particularly when using lookup functions like VLOOKUP or HLOOKUP. It specifically checks if the result of a formula is the #N/A error and lets you specify a custom value to return if that error occurs. This makes your spreadsheets more robust and user-friendly by preventing error messages from cluttering your data.
In simpler terms, IFNA helps you manage errors gracefully by providing an alternative output when a lookup fails to find a match.
Imagine you are managing a list of employees and their respective departments stored in a Google Sheets document:
| EmployeeID | EmployeeName | Department |
|---|---|---|
| 1 | John Doe | Sales |
| 2 | Jane Smith | Marketing |
| 3 | Bob Johnson | IT |
| AttendanceID | EmployeeID | DaysAbsent |
|---|---|---|
| 1 | 1 | 2 |
| 2 | 3 | 1 |
You want to find the department of each employee listed in the Attendance Table. If an employee ID does not exist in the Employees Table, you want to display "Not Found" instead of an error.
To achieve this, you would use the IFNA function in conjunction with VLOOKUP as follows:
=IFNA(VLOOKUP(B2, Employees!A:C, 3, FALSE), "Not Found")In this formula:
B2 is the cell containing the EmployeeID from the Attendance Table.Employees!A:C is the range where the function will look for the EmployeeID in the Employees Table.3 indicates that the function should return the value from the third column (Department)."Not Found" is the value that will be returned if there is no match found.When you apply the IFNA formula to the Attendance Table, the output would look like this:
| AttendanceID | EmployeeID | DaysAbsent | Department |
|---|---|---|---|
| 1 | 1 | 2 | Sales |
| 2 | 3 | 1 | IT |
If you were to add a row for an employee that doesn't exist, such as EmployeeID 4, the result would still show "Not Found" as follows:
| AttendanceID | EmployeeID | DaysAbsent | Department |
|---|---|---|---|
| 1 | 1 | 2 | Sales |
| 2 | 3 | 1 | IT |
| 3 | 4 | 0 | Not Found |
In this case, if you input EmployeeID 4 in the Attendance Table, the IFNA would return "Not Found" since there is no corresponding entry in the Employees Table.
IFNA is beneficial because it enhances the clarity of your data by preventing error messages from appearing in your spreadsheets. It allows you to provide meaningful feedback when a lookup fails, making your data easier to interpret. This is particularly useful in reports and dashboards where clarity is essential.
IFNA is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data integrity and usability.
Happy spreadsheeting!
You have a sales report where Column A lists product IDs and Column B contains sales figures. Using the IFNA formula, you can handle errors when looking up product IDs that don't exist, ensuring your report displays "Not Found" instead of an error message.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.