为什么这样做有效,并且可以正确查找值
但是一旦我改变了值的顺序,它就会产生不正确的值?
最佳答案
如果您阅读有关 LOOKUP 函数的注释,它会显示:
The LOOKUP function will only work properly if data in search_range or search_result_array is sorted. Use VLOOKUP, HLOOKUP, or other related functions if data is not sorted.
更改公式以使用 VLOOKUP,如下所示:
=VLOOKUP(D3, A1:B6, 2, FALSE)
语法:
VLOOKUP(search_key, range, index, [is_sorted])
search_key - The value to search for. For example, 42, "Cats", or I24.
range - The range to consider for the search. The first column in the range is searched for the key specified in search_key.
index - The column index of the value to be returned, where the first column in range is numbered 1.
is_sorted - [OPTIONAL - TRUE by default] - Indicates whether the column to be searched (the first column of the specified range) is sorted.
关于google-sheets - 查找功能不适用于未排序的列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26087153/