过滤数据透视表中的 0 值
Filter 0-values in PivotTable
我有以下 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
table 显示销售额(B 列)和 returns(C 列)产品。
我根据上面的数据创建了一个 Pivot-Table,结果如下:
Sum of Sent Quantity Sum of Returned Quantity
Product A 1.500 700
Product B 550 150
Product C 700 0
现在我使用退货数量作为报告过滤器。
我将“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
我必须改变什么才能达到我的目标结果?
所以,我在 "Sheet1" 中输入了你的数据,如下所示:
然后,在 "Sheet2" 我做了以下 table:
你的支点是什么table。但是单元格是用公式定义的:
B2: =SUMIF(Sheet1!$A:$A,Sheet2!A2,Sheet1!$B:$B)
C2: =SUMIF(Sheet1!$A:$A,Sheet2!A2,Sheet1!$C:$C)
剩下的就是往下拖(你知道的,它会自动调整)。现在,只需锁定第一行,然后您就可以对其应用任何过滤器。
这里有一种稍微不同的方法,它只需要一个 table,并允许您过滤和显示数据透视表中的值 table:
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)
将此公式复制到列中。
然后将退货数量总和设置为您的过滤器,它应该可以正常工作。可以为其他过滤器添加其他列,如果您愿意,您可以隐藏小计列。
我有以下 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
table 显示销售额(B 列)和 returns(C 列)产品。
我根据上面的数据创建了一个 Pivot-Table,结果如下:
Sum of Sent Quantity Sum of Returned Quantity
Product A 1.500 700
Product B 550 150
Product C 700 0
现在我使用退货数量作为报告过滤器。 我将“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
我必须改变什么才能达到我的目标结果?
所以,我在 "Sheet1" 中输入了你的数据,如下所示:
然后,在 "Sheet2" 我做了以下 table:
你的支点是什么table。但是单元格是用公式定义的:
B2: =SUMIF(Sheet1!$A:$A,Sheet2!A2,Sheet1!$B:$B)
C2: =SUMIF(Sheet1!$A:$A,Sheet2!A2,Sheet1!$C:$C)
剩下的就是往下拖(你知道的,它会自动调整)。现在,只需锁定第一行,然后您就可以对其应用任何过滤器。
这里有一种稍微不同的方法,它只需要一个 table,并允许您过滤和显示数据透视表中的值 table:
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)
将此公式复制到列中。
然后将退货数量总和设置为您的过滤器,它应该可以正常工作。可以为其他过滤器添加其他列,如果您愿意,您可以隐藏小计列。