Using VLOOKUP()

☆樱花仙子☆ 提交于 2019-12-17 17:12:31

问题


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

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!


回答1:


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




回答2:


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/>



来源:https://stackoverflow.com/questions/18808932/using-vlookup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!