Using VLOOKUP()

2019-01-15 22:29发布

I am using Excel's VLOOKUP() first time and I am having hard time with it. Here is the screenshot:

enter image description here

I wrote a formula to cell B8; =VLOOKUP(C8, $A$2:$C$5, IF(C8 = "W", 2,3))

I was expecting as a result 1, but I am getting the wrong result 0.25. Am I doing something wrong?

Thanks for the help!

2条回答
聊天终结者
2楼-- · 2019-01-15 23:17

A vlookup looks for a value in the leftmost column of a table and then returns a value from the row that the searched for value is found (how far along that row is determined by you).

In your example situation, you need to add in the 4th part below (NearOrExact)

The vlookup formula consists of 4 parts:

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.

Structure of the vlookup formula: =vlookup ( SearchFor , WhereToSearch , WhichColumn , NearOrExact )

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

查看更多
Ridiculous、
3楼-- · 2019-01-15 23:28

you were very close, vlookup takes teh lookup value first, so change the first C8 to A8

EDIT: As Barry Houdini points out in comments, also add FALSE as the fourth parameter

查看更多
登录 后发表回答