且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用OR条件过滤Excel数据透视表

更新时间:2023-02-04 13:43:07

理想情况下,在计算字段中完成数据透视表的所有数据操作。
但是,我发现您不能使用计算字段,而不是值部分(您正在尝试在此处看起来)的部分。

Ideally all data manipulation for a pivot table is done in a calculated field. However I've found that you can not use a calculated field for sections other than the value section (which you are trying to do here it seems).

我使用的一种解决方法是为源数据添加一个新列,其中包含一个公式来对数据进行分组。

A workaround I've used is to add a new column to the source data that contains a formula to group the data by.

您可以执行以下操作: (OR(A = Y,B = Z,C = X),显示,隐藏)$ b $($)

You could do something like:

IF(OR(A=Y, B=Z, C=X), "Display", "Hide")

并对该列的显示或隐藏结果进行过滤。

And filter on that column's Display or Hide results in the pivot.