VLOOKUP返回错误的行

时间:2019-12-27 19:48:12

标签: google-sheets google-sheets-formula gs-vlookup

我有一个非常简单的查找表:

enter image description here

我在B6中的公式是:

=VLOOKUP(A6,C1:D4,2)

所以我希望它返回1,而不是4?

3 个答案:

答案 0 :(得分:2)

您将忽略排序标志,该标志默认为 TRUE ,从而使其忽略完全匹配。

引用Google帮助:

建议将is_sorted设置为 FALSE 。如果设置为 FALSE ,则返回完全匹配。如果存在多个匹配值,则返回与找到的第一个值相对应的单元格的内容,如果找不到该值,则返回#N / A

检出此图像:

enter image description here

希望有帮助,加油!

答案 1 :(得分:0)

您错过了第四个vlookup参数。使用这个:

=VLOOKUP(A6, C1:D4, 2, 0)

或:

=VLOOKUP(A6, C1:D4, 2, ) 

或:

=VLOOKUP(A6, C1:D4, 2, FALSE)

获得完全匹配

答案 2 :(得分:0)

VLOOKUP(search_key, range, index, [is_sorted])

哪里

is_sorted - [optional]

Indicates whether the column to be searched (the first column of the 
   specified range) is sorted, in which case the closest match for 
   search_key will be returned.

如此

=VLOOKUP(A6,C1:D4,2) ==> will give you 4, because is_sorted=1, sorted of the              
                         column that to be search. If you change A6=Monthly,
                         it will give you 2

按原样提供给您,没有排序,因此您将is_sorted分配为0

=VLOOKUP(A6,C1:D4,2,0)