【问题标题】:How do I find the second MODE in google spreadhseet如何在谷歌电子表格中找到第二个模式
【发布时间】:2014-09-17 21:08:53
【问题描述】:

我有一个数字列表,我使用 =MODE 来查找最常出现的数字,我的问题是如何在同一个列表中找到第二个最常出现的数字?

【问题讨论】:

    标签: google-sheets spreadsheet


    【解决方案1】:

    在 Google 表格中,您可以使用 QUERY 函数轻松检索此类信息(以及更多信息)。假设您的数据仅在 A 列中是数值,没有标题:

    =QUERY({A:A,A:A},"select Col1, count(Col2) where Col1 is not null group by Col1 order by count(Col2) desc",0)

    将返回 A 列中的项目列表及其相关频率,从高到低排序。注意:如果A列包含文本字符串,则需要使用where Col1 != ''而不是where Col1 is not null

    现在您可以使用 INDEX 检索您需要的确切值;所以要检索第二个最频繁的值,您需要第一列中的第三个值(因为 QUERY 将填充输出中的标题行):

    =INDEX(QUERY({A:A,A:A},"select Col1, count(Col2) where Col1 is not null group by Col1 order by count(Col2) desc",0),3,1)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多