使用VLOOKUP()

我第一次使用Excel的VLOOKUP(),我很难用它。 这是截图:

在这里输入图像说明

我给B8写了一个公式, =VLOOKUP(C8, $A$2:$C$5, IF(C8 = "W", 2,3))

我期待结果1,但是我得到了错误的结果0.25。 难道我做错了什么?

谢谢您的帮助!

你非常接近,vlookup首先查找价值,所以把第一个C8改为A8

编辑:正如Barry Houdini在评论中指出的那样,还要添加FALSE作为第四个参数

一个vlookup在一个表的最左边的列中查找一个值,然后从查find的值的行中返回一个值(这个行的距离由你决定)。

在你的例子中,你需要添加下面的第四部分(NearOrExact)

vlookup公式由4部分组成:

 1. SearchFor this is the value that is being searched for. 2. WhereToSearch this is the range in which to search and in which the answer lives. 3. WhichColumn this is the column in the WhereToSearch range which has the answer in it. 4. NearOrExact you decide whether the vlookup should search for a close value or an exact value. 

vlookup公式的结构:= vlookup(SearchFor,WhereToSearch,WhichColumn,NearOrExact)

从< http://www.excelvlookuphelp.com/how-to-use-vlookup/ >