数据透视表按类别

时间:2020-09-17 21:11:20

标签: excel vba macos excel-formula

我很难为多个类别指定一个特定的ID。

例如,当前我在Excel中拥有

**ID | category**
apple a/b/c
banana c
orange a/c/d

如何在数据透视表中显示以下内容

**category | id (by count)**
a  2
b  1
c  3
d  1

目前,当我有数据透视表时,它会显示为

**category | id (by count)**
a/b/c  1
a/c/d  1
c      1

我已附上我的Excel文件以供审核。如果可能的话,请提供有关宏或vba代码或公式的帮助,

非常感谢您的帮助

2 个答案:

答案 0 :(得分:0)

实际上,每个类别应该有一列,而不是一列合并所有数据。 然后,您将可以选择: Sample pivot table

答案 1 :(得分:0)

您必须像这样组织数据源才能拥有良好的数据透视表:

enter image description here