【问题标题】:Selectable values in query function in Google SheetsGoogle表格中查询功能中的可选值
【发布时间】:2021-05-27 10:16:59
【问题描述】:

我在 Google 表格中为我的订单创建了一个摘要,并且能够做到这一点。

=QUERY('2021'!A1:AA5000, "select D,G,
count(V) where V is not null and V ='Shipped' and G ='NAJ' and D ='January'
group by D,G
label count(V) 'Total Orders'")

我想让 V、G 和 D 值不被硬编码,而是可以从下拉列表中选择。 在没有帮助的情况下上网搜索了半天。

【问题讨论】:

    标签: function google-sheets


    【解决方案1】:

    试试这个:

    =QUERY('2021'!A1:AA5000, "select D,G, count(V) where V is not null and V ='"&X1&"' and G ='"&X2&"' and D ='"&X3&"' group by D,G label count(V) 'Total Orders'")

    X1X2X3 是您的单元格引用。

    要获取所有月份,请尝试:

    =QUERY('2021'!A:AK, "select D,G, count(V) where V is not null and V ='Shipped' and G ='"&$D$4&"' and D "&if(E3=true,"is not null","='"&$D$3&"'")&" group by D,G label count(V) 'Total Orders'")

    【讨论】:

    • 太棒了。还有一件事,如果我想再添加一件像 D = ALL MONTH 这样的东西,它应该显示整个月。?
    • 或许and D is not null ?
    • 可以分享样张吗?不看数据上下文就很难知道。
    • 附样本表
    猜你喜欢
    • 2017-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多