问题描述
例如我有以下数据
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'"))
有没有办法做到这一点?