【问题标题】:"Query Completed with an Empty Output" How to get it to put a zero when there are no results instead“查询已完成,输出为空”如何在没有结果时将其置零
【发布时间】:2019-09-18 17:12:07
【问题描述】:

我的查询出现错误

#N/A 查询已完成,输出为空。

=sum((query(importrange("mysheet","CR"),"select Col7 where Col1 ='"&A4&"' and Col2 ='"&B4&"' and Col13!='Cancelled' and Col13!='Rejected' ",0)))

当引用的工作表中存在数据时,该功能正常工作。问题是当我将它向下拖动时,CR 数据集中不存在某些列引用。如何获得零而不是错误?

【问题讨论】:

    标签: google-sheets sum google-sheets-formula google-sheets-query


    【解决方案1】:

    您需要像这样使用IFERROR,如果发生错误将导致0:

    =SUM(IFERROR(QUERY(IMPORTRANGE("mysheet","CR"), 
     "select Col7 
      where Col1 ='"&A4&"' 
        and Col2 ='"&B4&"' 
        and Col13!='Cancelled' 
        and Col13!='Rejected' ", 0)))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-07
      • 1970-01-01
      • 2018-08-19
      • 1970-01-01
      • 2021-04-08
      • 2020-04-19
      相关资源
      最近更新 更多