0

我有以下 Excel 电子表格:

      A                  B                    C
    Product         Sent Quantity       Returned Quantity
1   Product A           500                     0
2   Product A           400                   300
3   Product A           600                   400
4   Product B           250                     0
5   Product B           300                   150
6   Product C           700                     0

该表显示了产品的销售额(B 列)和退货(C 列)。

我根据上面的数据创建了一个数据透视表,结果如下:

                Sum of Sent Quantity          Sum of Returned Quantity
Product A           1.500                          700
Product B             550                          150
Product C             700                            0

现在我使用 Returned Quantity 作为Report Filter。我将“150”设置为过滤条件,我得到以下结果:

                 Sum of Sent Quantity          Sum of Returned Quantity
Product B             550                          150

到目前为止一切正常。

现在我将过滤器从“150”更改为“0”,我得到以下结果:

                Sum of Sent Quantity          Sum of Returned Quantity
Product A              500                            0
Product B              250                            0
Product C              750                            0

但是,我的目标结果是:

              Sum of Sent Quantity          Sum of Returned Quantity
Product C              700                            0

我必须改变什么才能达到我的目标结果?

4

2 回答 2

0

这是一种稍微不同的方法,它只需要一个表,并允许您在数据透视表中过滤和显示值:

      A              B                C                  D
1   Product     Sent Quantity   Returned Quantity   Sum of Returned Quantity
2   Product A       500                 0               700
3   Product A       400               300               700
4   Product A       600               400               700
5   Product B       250                 0               150
6   Product B       300               150               150
7   Product C       700                 0                 0

单元格D2中的公式是=SUMIF($A:$A,$A2,C:C)将此公式复制到列中。

然后将返回数量的总和设置为您的过滤器,它应该可以正常工作。可以为其他过滤器添加其他列,如果您愿意,可以隐藏小计列。

于 2017-10-18T17:59:38.493 回答
0

因此,我在“Sheet1”中输入了您的数据,如下所示:

在此处输入图像描述

然后,在“Sheet2”中,我制作了下表:

在此处输入图像描述

哪个是您的数据透视表。但是单元格是用公式定义的:

B2:=SUMIF(Sheet1!$A$2:$A$7,Sheet2!A2,Sheet1!$B$2:$B$7)

C2:=SUMIF(Sheet1!$A$2:$A$7,Sheet2!A2,Sheet1!$C$2:$C$7)

剩下的就是把它往下拉(你知道它会自动调整)。现在,只需锁定第一行,然后您就可以对其应用任何过滤器。

于 2017-08-04T11:33:57.517 回答