【问题标题】:Google Sheets - Using Query with CountGoogle 表格 - 将查询与计数一起使用
【发布时间】:2022-01-05 13:01:32
【问题描述】:

我在 I3:Z 中有数据,我已将命名范围分配给 - “数据”。

我有以下公式:

=QUERY(UNIQUE(FLATTEN(Data)))

返回所有唯一数据条目的列表。

我还想在公式中添加一个计数,以便显示每个数据条目出现的次数,然后按所述数字对整个结果进行排序。

谢谢

【问题讨论】:

    标签: google-sheets unique counting flatten google-query-language


    【解决方案1】:

    使用:

    =QUERY(FLATTEN(Data); 
     "select Col1,count(Col1)
      where Col1 is not null 
      group by Col1 
      order by count(Col1) desc 
      label count(Col1)''")
    

    【讨论】:

      【解决方案2】:

      试试

      =query({query(flatten(data),"select Col1 where Col1 is not null"),sequence(COUNTA(data),1,1,0)},"select Col1,sum(Col2) group by Col1 label sum(Col2) 'Nb' ")
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-08-16
        • 1970-01-01
        • 2021-03-25
        • 1970-01-01
        • 2015-12-17
        • 2021-11-16
        • 1970-01-01
        • 2022-12-04
        相关资源
        最近更新 更多