统计数据透视表中的行和列

统计数据透视表中的行和列

你好,我有一张表格,收集了以下内容

++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Name + Address + Borough + Postcode + Date Added +
++++++++++++++++++++++++++++++++++++++++++++++++++++
 John   blah..    London    XX12 XXX   21/01/2012
 Roger  blah..    Surrey    ZZ14 ZZZ   18/02/2013
 Mary   blah..    Surrey    EE17 EEE   18/02/2013
 Helen  blah..    Hackney   VV25 VVV   19/05/2014
++++++++++++++++++++++++++++++++++++++++++++++++++++

Borough我有一个以作为列和作为行(我将其分为月份和年份)的数据透视表Date Added,其内容如下:

++++++++++++++++++++++++++++++++++++++++++
+ Date Added + London + Hackney + Surrey +
++++++++++++++++++++++++++++++++++++++++++
+ 2012       +        +         +        +
+    Jan     +        +         +        +
+ 2013       +        +         +        +
+    Feb     +        +         +        +
+ 2014       +        +         +        +
+    May     +        +         +        +
++++++++++++++++++++++++++++++++++++++++++

我的问题是如何让它计算或显示数据中的数字,例如如下所示,因为我当前的表格显示如上所示的空白字段?

++++++++++++++++++++++++++++++++++++++++++
+ Date Added + London + Hackney + Surrey +
++++++++++++++++++++++++++++++++++++++++++
+ 2012       +        +         +        +
+    Jan     +    1   +    0    +    0   +
+ 2013       +        +         +        +
+    Feb     +    0   +    0    +    2   +
+ 2014       +        +         +        +
+    May     +    0   +    1    +    0   +
++++++++++++++++++++++++++++++++++++++++++

答案1

在值字段中数据透视表,您需要输入要求和或计数的内容。然后单击它以选择要执行的计算(求和、计数等)。

在此处输入图片描述

答案2

我对之前的答案感到困惑,所以这里终于对我有用了。我有这样的原始数据:

01/01/2015     /r/foo
01/01/2015     /r/foo
01/02/2016     /r/bar

等等,我创建了一个如下所示的数据透视表:

             /r/foo     /r/bar      /r/fizz
01/01/2015
01/02/2016

我想计算每个月每行的每个实例。在数据透视表字段中,右键单击要对实例求和的值,如下所示:

在此处输入图片描述

它填写了我的图表:

             /r/foo     /r/bar    /r/fizz
01/01/2015        2          0          0
01/02/2016        0          1          0

相关内容