VLOOKUP公式返回'#VALUE!'而不是应该返回的文本值 [英] VLOOKUP formula returns '#VALUE!' instead of the text value it should return

查看:1444
本文介绍了VLOOKUP公式返回'#VALUE!'而不是应该返回的文本值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  = IF(VLOOKUP(A2,VS!$ B2:$ B98 ,1,FALSE),A2,NA)

我想做的是,如果找到A2表中的B2值从B2到B92,则函数将返回并将A2(在VS表中)的值输入到当前表中。但是,不是得到A2值,它们是文本值,所以我得到了 #VALUE!



解决方案?

解决方案

请尝试以下操作:

  = IFERROR(VLOOKUP(A2,VS!$ B2:$ B98,1,FALSE),)

如果找到A2,在B2:B98范围内找不到A2,返回(空白)而不是#VALUE,则返回值。 >

其次,如果您计划扩展此公式,则可能希望通过在数字之前添加$使表格更严格输入,以使范围不会移动:

  = IFERROR(VLOOKUP(A2,VS!$ B $ 2:$ B $ 98,1,FALSE),) 

最后,尝试右键单击 - >格式化单元格...并将列A格式设置为文本,列B(在表VS上)作为文本。有时Excel的自动格式化功能会影响vlookup的结果。


I wrote this formula in an Excel cell:

=IF(VLOOKUP(A2, VS!$B2:$B98,1,FALSE ),A2,NA)

What I want to do is, if it finds the A2 value in VS table from B2 to B92 then the function will return and input the value in A2 (in VS table) to my current table. But instead of getting the A2 values, which are text values, I got #VALUE!.

How can I solve it?

解决方案

Try the following:

=IFERROR(VLOOKUP(A2,VS!$B2:$B98,1,FALSE),"")

What this does is return the value if it finds A2, in the range B2:B98, it doesn't find A2, it returns "" (blank), instead of #VALUE.

Secondly if you're planning on extending this formula, you may want to make the table more 'strictly typed' by adding '$' before the numbers so the range doesn't shift:

=IFERROR(VLOOKUP(A2,VS!$B$2:$B$98,1,FALSE),"")

Lastly, try right click -> Format Cells... and format column A as 'Text' and column B (on sheet VS) as Text as well. Sometimes Excel's Autoformatting features mess with vlookup's results.

这篇关于VLOOKUP公式返回'#VALUE!'而不是应该返回的文本值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆