0

我已经检查了以前关于如何使用多个条件进行 vlookup 的帖子,但是当我将它应用到我的工作簿时,我得到一个"#N/A"。对于我做错的任何反馈,我将不胜感激。

问题(简单示例):

A1=Vlookup(B1&C1,D:E,2,False)

  • B1= 123
  • C1= 45
  • D1= 12345
  • E1=“好”

我希望公式返回“好”的值 - 但是我目前得到“#N/A”。

感谢任何帮助

4

2 回答 2

3

连接是一个字符串。D1 中的值是数字。“12345”<> 12345。那是你的问题。

如果您只处理正在连接的数值,这将通过将连接的字符串转换为数值来修复它,该数值应返回匹配项。

=VLOOKUP((B1&C1)*1,D:E,2,False)

如果您在 B&C 列中处理字符串和/或数字类型值的混合,这可能需要一些额外的微调。

于 2013-03-21T12:01:07.387 回答
2

If you concatenate two cells with &, Excel converts numbers to text. And internally, the text 12345 is not the same as the value 12345.

Thus you can solve your problem with one of these options:

  1. Convert the text back to a number - either using =VLOOKUP(VALUE(B1&C1),... or =VLOOKUP((B1&C1)*1,...
  2. Convert column D to text (using the TEXT function
  3. Use arithmetic instead of concatenation: =VLOOKUP(B1*100+C1,...
于 2013-03-21T12:02:51.980 回答