Your Search Bar For Shrewd Tips

How Do I Clear Na In Vlookup?


If your VLOOKUP formula returns #N/A, Excel or Google Sheets could not find the lookup value in the first column of the range you specified. You can hide the error with a formula such as IFNA, but it is often better to check why the match failed first. This guide explains how to clear #N/A in VLOOKUP, troubleshoot common causes, and choose the right formula for your spreadsheet.

What Does #N/A Mean in VLOOKUP?

#N/A stands for “not available.” In a VLOOKUP formula, it usually means the function searched the first column of its lookup range but did not find a value that matches the lookup value. For example, if you search for product code A104 but the lookup column contains A-104, VLOOKUP treats them as different values and returns #N/A.

A typical VLOOKUP formula looks like this:

=VLOOKUP(A2,$E$2:$G$100,3,FALSE)

In this example, Excel searches for the value in A2 in the first column of E2:G100. If it finds an exact match, it returns the value from the third column of that range. If there is no exact match, the formula returns #N/A.

There are two ways to handle the error: correct the lookup problem or replace the displayed error with a more useful result. If the match should exist, troubleshoot the formula and data before hiding the error.

Quickest Way to Clear #N/A in VLOOKUP

If you simply want to replace #N/A with a message, wrap your VLOOKUP in the IFNA function:

=IFNA(VLOOKUP(A2,$E$2:$G$100,3,FALSE),"Not found")

This formula displays “Not found” when VLOOKUP returns #N/A. If the lookup succeeds, it returns the matched value as usual. To display a blank instead, use an empty text string:

=IFNA(VLOOKUP(A2,$E$2:$G$100,3,FALSE),"")

IFNA is available in modern versions of Excel and Google Sheets. It handles the specific #N/A error without concealing other errors, such as #REF! or #VALUE!.

Use IFERROR to Hide VLOOKUP Errors

You can also use IFERROR to return a custom result whenever a formula produces an error:

=IFERROR(VLOOKUP(A2,$E$2:$G$100,3,FALSE),"Not found")

This works in Excel and Google Sheets, including versions that do not support IFNA. However, IFERROR catches every error, not just #N/A. That means it could hide a different issue in the formula or source data. Use it when you deliberately want to replace all errors; use IFNA when you only want to handle a missing match.

For example, returning a blank can make a report look cleaner, but it may also make missing records harder to notice. Consider using a clear message such as “No matching ID” while you are testing the spreadsheet. Once you confirm that missing values are expected, you can change the message to a blank if that suits the report.

Check That VLOOKUP Is Searching the Correct Column

VLOOKUP searches only the first column in the range you give it. It cannot look to the left of that column. If the value you want to match is in column F, but your range starts in column G, VLOOKUP will not find the value—even if it appears elsewhere in the selected cells.

Check the table range in your formula. In =VLOOKUP(A2,$E$2:$G$100,3,FALSE), the lookup value must be in column E because E is the first column of the range. The return value comes from the third column of the selected range, which is column G.

  • Make sure the lookup column is the first column in the table range.
  • Confirm that the range includes the rows containing your data.
  • Check that the column index number points to the column you want returned.
  • Use dollar signs, such as $E$2:$G$100, if you will copy the formula down.

If the lookup value is to the right of the result you need, consider using XLOOKUP in a supported version of Excel or Google Sheets. Unlike VLOOKUP, XLOOKUP can return results from columns on either side of the lookup column.

Use FALSE for an Exact Match

The fourth VLOOKUP argument controls how the function searches. For most lookups involving names, product codes, account numbers, or other identifiers, use FALSE for an exact match:

=VLOOKUP(A2,$E$2:$G$100,3,FALSE)

You can also use 0 in place of FALSE. If you omit the fourth argument or use TRUE, VLOOKUP performs an approximate match. Approximate matching is intended for ordered ranges, such as tax brackets or commission bands. The first column generally needs to be sorted in ascending order for reliable results.

For a list of unique codes or names, an exact-match formula is usually the safer choice. It prevents VLOOKUP from returning a nearby value simply because an exact value was not found.

Look for Extra Spaces and Hidden Characters

Values may appear identical on screen but differ because one contains an extra space or a nonprinting character. A lookup value such as North Region will not match North Region if the second entry has a trailing space. Data copied from websites, reports, or other systems is especially likely to contain these inconsistencies.

To remove ordinary leading and trailing spaces from a value, try the TRIM function. For example:

=VLOOKUP(TRIM(A2),$E$2:$G$100,3,FALSE)

This trims the lookup value in A2, but it does not clean the values in the lookup column. If the source data also contains extra spaces, create a helper column that cleans those values with TRIM, then use that cleaned column as the first column of the lookup range.

Some imported data contains nonbreaking spaces or other hidden characters that TRIM does not remove. You may need to use functions such as SUBSTITUTE or CLEAN, or clean the source data before looking it up. Check a few failing records carefully rather than assuming the visible text tells the whole story.

Check for Numbers Stored as Text

A number stored as text is not always the same as a number stored as a numeric value. For instance, the text value "00125" and the number 125 may look related, but they are not identical lookup values. This commonly happens when importing data or working with IDs that contain leading zeros.

Check whether both the lookup value and the values in the first lookup column use the same data type. You can often spot numbers stored as text by a warning indicator in Excel, or by noticing that values are aligned differently from other numbers. Avoid converting identifiers automatically if leading zeros are meaningful.

If the values should be numeric, convert both sides to numbers using a consistent method. If they are codes where leading zeros matter, keep both sides as text and make sure the zeros are present in each dataset. Consistency is more important than choosing one format for every type of value.

Confirm the Lookup Value Exists in the Source Data

Sometimes VLOOKUP returns #N/A because the requested value genuinely is not in the lookup table. The record may not have been added yet, the source list may be outdated, or the lookup value may have been typed incorrectly. Search the first column manually or use Find to check whether the value exists.

Also verify that your formula range reaches the row where the value appears. A formula that refers to $E$2:$G$100 will not search row 101 or any rows below it. If the dataset changes regularly, consider converting it into an Excel Table so formulas can refer to a range that expands with the data.

When the record is genuinely absent, returning “Not found,” “Pending,” or a blank may be appropriate. Choose a result that makes sense for the spreadsheet’s purpose and does not make missing information look like a confirmed value.

Check the Column Index and Formula References

The third VLOOKUP argument is the number of the return column within the selected range, not the worksheet’s column number. If your range starts at column E, then E is column 1, F is column 2, and G is column 3. An incorrect column index may return the wrong result or cause another error.

When copying a formula down or across, check that the references still point to the intended cells. A lookup value reference such as A2 should usually change to A3 on the next row, while a fixed lookup range should remain constant as $E$2:$G$100. Without absolute references, the range may shift and exclude the correct data.

For a clearer formula, you can use named ranges or an Excel Table. These options make it easier to see which data the formula searches and can reduce mistakes when a workbook grows.

Common VLOOKUP Fixes at a Glance

  • To show a message for missing matches: use =IFNA(VLOOKUP(A2,$E$2:$G$100,3,FALSE),"Not found").
  • To show a blank for #N/A: replace "Not found" with "".
  • To catch every formula error: use IFERROR instead of IFNA.
  • To avoid approximate-match surprises: set the last VLOOKUP argument to FALSE or 0.
  • To fix inconsistent text: check spaces, hidden characters, spelling, and punctuation in both datasets.
  • To fix type mismatches: make sure both lookup values are consistently stored as numbers or text.
  • To fix a range problem: confirm the lookup column is first and the range includes all relevant rows.

Frequently Asked Questions About #N/A in VLOOKUP

Why does VLOOKUP return #N/A when the value is clearly there? The value may contain extra spaces or hidden characters, use a different data type, or fall outside the selected range. The lookup column may also be positioned somewhere other than the first column of the range.

How do I replace #N/A with zero? Wrap the formula in IFNA and use zero as the result: =IFNA(VLOOKUP(A2,$E$2:$G$100,3,FALSE),0). Only do this if zero is an appropriate substitute; otherwise, it could be mistaken for a real value.

Should I use IFNA or IFERROR? Use IFNA to handle only missing matches. Use IFERROR when you intentionally want to replace any error produced by the formula. During troubleshooting, fixing the underlying cause is usually better than masking it.

Does this work in Google Sheets? Yes. Google Sheets supports VLOOKUP, IFNA, and IFERROR. The same checks for exact matches, data types, spaces, and lookup ranges apply.

Conclusion

To clear #N/A in VLOOKUP, first decide whether the lookup value should exist. If it should, check the search column, range, exact-match setting, data types, spaces, and formula references. If the value is legitimately missing, use IFNA to display a helpful message or a blank. Choose IFERROR only when you want to hide all kinds of formula errors, not just missing matches. Fixing the source of the problem will make your spreadsheet more accurate, while the right error-handling formula will keep the final report easy to read.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →