【问题标题】:What is the syntax when including standard Google Sheets functions within the QUERY function?在 QUERY 函数中包含标准 Google 表格函数时的语法是什么?
【发布时间】:2019-09-14 20:58:29
【问题描述】:
我想使用 Google 表格中的 LARGE 函数在查询查找中引用一个单元格。我尝试了以下代码的变体但没有成功:
=QUERY(C2:D49,"select C where D = "large(D2:D49,2)"")
这让我想知道使用标准函数在查询中引用单元格值的规则是什么。
【问题讨论】:
标签:
function
google-sheets
syntax
google-sheets-formula
google-sheets-query
【解决方案1】:
语法是:
=QUERY(C2:D49, "select C where D = "&LARGE(D2:D49, 2), 0)
【解决方案2】:
查询字符串是纯字符串。只要结果字符串是有效的查询,就没有特殊规则适用。适用于电子表格中字符串的标准规则也适用于查询字符串。在这种情况下,您正在寻找字符串连接:
="Maximum number of players allowed: "&large(D2:D49,1)
=JOIN(" ", "Maximum number of players allowed:", large(D2:D49,1))