VLOOKUP giving #N/A and I have no idea why

2019-07-03 22:42发布

enter image description here

Why doesn't this work? I tried checking for whitespace, made sure length was the same, etc. Driving me nuts! I just want Alabama! The error given is "Value not available".

4条回答
【Aperson】
2楼-- · 2019-07-03 23:19

The order of your column is wrong. The leftmost column must contain the value you are matching. What you are doing is looking for AL in the State Name column. Of course, excel can't see it and thus returns #N/A!.

You can try this:

=INDEX($A:$A,MATCH(D1,$B:$B,0),1)

Hope this helps.

查看更多
我命由我不由天
3楼-- · 2019-07-03 23:30

The formula looks for "AL" in the first column specified (column A). It only finds "Alabama", so returns error.

查看更多
Ridiculous、
4楼-- · 2019-07-03 23:31

It can be slightly easier, even:

=INDEX(A:A,MATCH(D1,B:B))
查看更多
smile是对你的礼貌
5楼-- · 2019-07-03 23:33

The usual solution is to apply =MATCH to find the row number in the array:

=MATCH(D1,B:B,0)  

will search for the value in D1 in ColumnB (the last 0 means exactly) and hopefully return 2 (the second row in the chosen array - ie the whole of ColumnB). This can then be fed into:

=INDEX(A:A,MATCH(D1,B:B,0))  

where it becomes the second row of ColumnA, ie Alabama

Details here =MATCH =INDEX and also http://www.excelhero.com/blog/2011/03/the-imposing-index.html

查看更多
登录 后发表回答