【问题标题】:Google Sheets, how to count if text is set column is set to trueGoogle表格,如果设置了文本,如何计算列设置为true
【发布时间】:2020-06-08 19:22:26
【问题描述】:

我有一个具有以下布局的 Google 表格

Key Points  Category    Done
1     4       A          Yes
2     4       B 
3     1       B 
4     5       C          Yes
5     7       D          Yes
6     4       B 
7     2       C          Yes

如果“完成”为“是”,我需要一个可以根据类别对分数求和的公式。所以输出应该是

Points done    Category
7                C
4                A
7                D

我可以使用哪个公式? (我不想使用数据透视表)

【问题讨论】:

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


    【解决方案1】:

    尝试:

    =QUERY({A2:D}; "select sum(Col2),Col3 where Col4 = 'Yes' group by Col3 label sum(Col2)''")
    

    【讨论】:

    • 它给了我这个错误:Unable to parse query string for Function QUERY parameter 2: ADD_COL_TO_GROUP_BY_OR_AGG: Col3
    • 我相信它可能需要“group by”子句来允许 sum(Col2) 工作。试试: =QUERY({A2:D}; "select sum(Col2),Col3 where Col4 = 'Yes' group by Col3 label sum(Col2)''") 你也可以改变它们出现的顺序,使用“order by Col3”,如果你想输出按类别排序,或者“order by sum(Col2)”,如果你想按点排序。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-28
    • 2021-08-14
    • 1970-01-01
    • 1970-01-01
    • 2016-03-31
    • 1970-01-01
    相关资源
    最近更新 更多