简体   繁体   English

Excel VLOOKUP找不到正确的行

[英]Excel VLOOKUP not finding correct row

I have the following table of two columns: 我有两列的下表:

102-6956821-1091413 1
115-8766130-0234619 2
109-8688911-2954602 3
109-7731824-8641056 4

If I put in the following VLOOKUP: 如果我输入以下VLOOKUP:

=+VLOOKUP(B2,B$2:C$5,2)

I get the result of: 我得到的结果是:

1
2
1
1

If I change it to =+VLOOKUP(B2,B$2:C$5,2, FALSE) I get the expected: 如果我将其更改为= + VLOOKUP(B2,B $ 2:C $ 5,2,FALSE),则会得到预期的结果:

1
2
3
4

But why is this? 但是为什么呢? There is an exact match available so why does it need to approximate? 可以使用精确匹配,为什么需要近似呢? If it is, why is it generating the numbers it is? 如果是,为什么要生成它的数字? How is it reducing that text value to a number that it is approximating from? 如何将文本值减小为近似值? Thanks! 谢谢!

Transfer from comment for the sake of an answer: 为了回答,从评论转移:

If your search list (ColumnB) were sorted you would see the results you expect anyway (though in a different order). 如果对搜索列表(ColumnB)进行了排序,则无论如何您都会看到期望的结果(尽管顺序不同)。 For speed, VLOOKUP is using a binary search method for which an ordered list is necessary if to achieve meaningful results. 为了提高速度,VLOOKUP使用二进制搜索方法 ,如果要获得有意义的结果,则必须使用有序列表。 There are exact matches only in the first half of the unsorted list (hence 1 and 2 are correct but neither 1 nor 1 is). 仅在未排序列表的前半部分存在完全匹配项(因此12是正确的,但11都不正确)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM