【问题标题】:Count number of occurrences of a word across multiple sheets in google sheets计算一个单词在谷歌工作表中的多个工作表中出现的次数
【发布时间】:2020-09-20 11:59:25
【问题描述】:

有没有办法计算一个单词在多张纸上出现的次数?

例如我有以下数据

Sheet1
ANIMALS
cat
cat
cat
dog
mouse
Sheet2
ANIMALS
cat
dog
dog
elephant

在第 3 页我希望它出现

ANIMALS     COUNT
cat         4
dog         3
mouse       1
elephant    1

它也应该是动态的,所以当我在表 1 和表 2 中添加条目时,它将出现在表 3 中

我在表 3 中使用了以下公式,但它并没有像我想象的那样工作

=ArrayFormula(QUERY({Sheet1!A2:A1000,Sheet2!A2:A1000},"select Col1, count(Col2) where Col1 != '' group by Col1 label Col1 'animals', count(Col2) 'Count'"))

有没有办法做到这一点?

【问题讨论】:

    标签: google-sheets google-sheets-formula array-formulas


    【解决方案1】:

    您需要将{Sheet1!A2:A1000,Sheet2!A2:A1000} 替换为{Sheet1!A2:A1000;Sheet2!A2:A1000}

    所以你的公式变成了

    =QUERY({Sheet1!A2:A1000;Sheet2!A2:A1000},"select Col1, count(Col1) where Col1 != '' group by Col1 label Col1 'animals', count(Col1) 'Count'")
    

    使用; 而不是, 可以将一列堆叠在另一列之上。

    【讨论】:

    • 很好的解决方案!
    • 感谢您抽出宝贵时间接受。很高兴我能帮上忙。
    猜你喜欢
    • 2022-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多