N kinds of reasons depth analysis of the query process VLOOKUP # N / A appears

        In use Vlookup function, the error value # N / A frequently occur. So why exactly appear # N / A is from what we should do to troubleshoot the error? Next to our in-depth analytical several reasons # N / A error value occurs query.
① no such person

# N / A error formula generally represents not find the requested content searching, such as the inquiry result D, but the data source object D does not exist, it returns # N / A:


In this case, to avoid the appearance and subsequent impact calculated error value table, through Iferror function, the error value is replaced with text or numerical information:

Syntax: = IFERROR (expression used to replace the contents of the error value)

② data source reference error

If you exclude the first reason still returns an error value, this time you should check your formula for it!
1, check whether the data source reference the correct

FIG follows: lookup by name score, the data source is from A (number) selected by the column starts, a data source does not satisfy the first column must contain lookup based on this requirement, it returns # N / A error value, it should be the correct formula:

=VLOOKUP(E2,B1:C4,2,0)

2, check the data source if there is an absolute reference

Below, the query name is selected when the C data source B2: C4, copying the formula down, since the source data into a relative reference B3: C5, A lead not query results. Under normal circumstances, when data query is in a fixed range, so the scope of data needs to be an absolute reference.

③ lookup value or data source contains other characters

When Find, required to find the value of the data source object content must be exactly the same, so if you find the value or data source contains spaces, non-printing characters, super downright unknown character, then certainly return # N / A, so be sure to find ways to remove them, a different character deletion methods are not the same.


1, there is a space

By Find and Replace, shortcut [Ctrl + H] to find content enter a space character, replace the contents remain empty, Replace All to delete:

2, the presence of non-printing characters

As shown below, A2 to D2 name look identical, but VLOOKUP returns # N / A, also with Ctrl + H not find any spaces:


At this point, the available three kinds of way to determine whether there is a non-printing characters:

Method 1: a = Analyzing

方法2:用Len函数判断长度是否相等

方法3:粘贴至TXT文档,让非打印字符现形

删除非打印字符的方法:CLEAN函数

3、存在未知字符

如下图所示,A2与D2的数字看起来完全相同,但是VLOOKUP返回#N/A,用Ctrl+H也查找不到任何空格,用Len函数判断长度并不相等,但是用Clean函数却依旧无法清除:


这是我遇到的最顽固的字符了,最终是借助Word实现了字符的删除,我们来看一下方法:

    1、将A列数据复制粘贴到Word(只粘贴文本);

    2、开始-段落-打开显示编辑标记(可以看到数字面前有不认识的字符)

    3、按住Alt键拖动鼠标垂直选择右侧数字内容(这个字符不能用查找替换删除)

    4、Ctrl+C复制选择好的数字,粘贴到Excel中,此时,公式已返回正确结果

④  数据类型不匹配

进行查找时,要求查找值与数据源对象数据类型必须完全一致,如果查找值是文本类型,数据源是数字类型,也会导致VLOOKUP函数查找出错,这时只需要将数据类型修改为一致即可:


以上是查询过程中#N/A出现的原因及解决办法,以后大家出现这种错误就可以从这几个方面进行排查了:

    是否查无此人

    数据源是否引用出错

    数据源是否绝对引用

    存在空格、非打印字符、其他字符

    数据类型不匹配

发布了191 篇原创文章 · 获赞 660 · 访问量 25万+

Guess you like

Origin blog.csdn.net/m0_37806112/article/details/100050298