google-sheets - 查找功能不适用于未排序的列表

标签 google-sheets lookup

为什么这样做有效,并且可以正确查找值

enter image description here

但是一旦我改变了值的顺序,它就会产生不正确的值?

enter image description here

最佳答案

如果您阅读有关 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/

相关文章:

c# - 无法向 Google 电子表格添加行

r - 动态构建查找多列的调用

python - 在一列字符串中搜索多个子串并返回子串类别

mysql - Glassfish MySQL JNDI 查找失败

r - 查找/替换或映射,使用 R 中的查找表

python - Pymongo 聚合多个条件 : lookup, unwind, redact, cond, sort and limit

if-statement - 如何比较 Google 表格中的两个公式(计算)单元格

javascript - 如何创建谷歌脚本通过参数从文件夹路径查找文件?

javascript - 使用谷歌应用程序脚本返回多次出现的值

javascript - 如何在 Google 表格中使用 importjson 修复 "SyntaxError: Unexpected token: a"