在百列中查找字符串的计数

Find count of String in hundred column

我在电子表格中有数百条数据。我想知道那个水果名称的计数。我怎样才能在电子表格中做到这一点? 示例(预期)输出:

Banana = 38
Grape = 41
Dates = 29
Orange = 32
..
etc

QUERY()是个不错的选择。

=QUERY(FLATTEN(B2:J),"select Col1, count(Col1) group by Col1 label Col1 'Fruits', count(Col1) 'Count'")

如果您想排除空白单元格,请使用

=QUERY(FLATTEN(B2:J),"select Col1, count(Col1) 
where (Col1 is not null) 
group by Col1 
label Col1 'Fruits', count(Col1) 'Count'")