VLOOKUP 返回错误行
VLOOKUP returning wrong row
我有一个相当简单的查找 table:
我在B6中的公式是:
=VLOOKUP(A6,C1:D4,2)
所以我希望它是 return 1,而不是 4?
您错过了第 4 个 vlookup 参数。使用这个:
=VLOOKUP(A6, C1:D4, 2, 0)
或:
=VLOOKUP(A6, C1:D4, 2, )
或:
=VLOOKUP(A6, C1:D4, 2, FALSE)
获得完全匹配
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)
您省略了排序标志,然后默认为 TRUE 从而使其忽略完全匹配。
引用 Google 帮助:
It’s recommended to set is_sorted to FALSE. If set to FALSE, an exact match is returned. If there are multiple matching values, the content of the cell corresponding to the first value found is returned, and #N/A is returned if no such value is found.
查看这张图片:
希望对你有所帮助,干杯!
我有一个相当简单的查找 table:
我在B6中的公式是:
=VLOOKUP(A6,C1:D4,2)
所以我希望它是 return 1,而不是 4?
您错过了第 4 个 vlookup 参数。使用这个:
=VLOOKUP(A6, C1:D4, 2, 0)
或:
=VLOOKUP(A6, C1:D4, 2, )
或:
=VLOOKUP(A6, C1:D4, 2, FALSE)
获得完全匹配
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)
您省略了排序标志,然后默认为 TRUE 从而使其忽略完全匹配。
引用 Google 帮助:
It’s recommended to set is_sorted to FALSE. If set to FALSE, an exact match is returned. If there are multiple matching values, the content of the cell corresponding to the first value found is returned, and #N/A is returned if no such value is found.
查看这张图片:
希望对你有所帮助,干杯!