尽管 'where not null' 仍继续查询 select 行

Query continues to select rows despite 'where not null'

我在 google sheets 中使用查询命令获取文本字符串的左侧变量,将其转换为数字并将其与其他列相加。当我尝试使用 where Col1 is not null 的查询命令时,它会继续拉出每一行,留下充满零的 sheet。我错过了什么?这是完整的公式

=Query(ArrayFormula(value(left(T2:AC))),"select Col1+Col2+Col3+Col4+Col5+Col6+Col7+Col8+Col9+Col10,Col9 where Col1 is not null label Col1+Col2+Col3+Col4+Col5+Col6+Col7+Col8+Col9+Col10 'Total', Col9 'Q9'")

VALUE 将空字符串 ("") 转换为 0,如您在官方文档中的示例中所见。

因此,在对单元格使用VALUE之前,您应该先检查单元格是否为空。一种选择是使用 ISBLANK:

=ARRAYFORMULA(IF(ISBLANK(E2:F),,VALUE(LEFT(E2:F))))