如何制作具有两组列的透视表,每个列的过滤方式不同


2

假设我有以下Excel数据:

+------+-------+--------+
| Item | User  | Status |
+------+-------+--------+
| MTB  | Bob   | A      |
| QCD  | Bob   | A      |
| MTB  | Alice | B      |
| DFXR | Carol | A      |
| QCD  | Carol | B      |
| MTB  | Carol | B      |
| MTB  | Carol | A      |
| DFXR | Carol | B      |
+------+-------+--------+

我可以透视这个数据,让每用户通过项目项目类型的数量,通过将UserRow Labels框,ItemColumn Labels框中,并Count of ItemValues框中。这给出了以下关键点:

+-------------+------+-----+-----+-------------+
| Row Labels  | DFXR | MTB | QCD | Grand Total |
+-------------+------+-----+-----+-------------+
| Bob         |      |   1 |   1 |           2 |
| Alice       |      |   1 |     |           1 |
| Carol       |    2 |   2 |   1 |           5 |
| Grand Total |    2 |   4 |   2 |           8 |
+-------------+------+-----+-----+-------------+

我想创建一个枢轴,该枢轴将构成两套独立的Count of Item列:一组用于Status =“ A”,另一组用于Status =“ B”。它看起来像这样:

+-------------+----------+---------+---------+----------+---------+---------+-------------+
| Row Labels  | DFXR (A) | MTB (A) | QCD (A) | DFXR (B) | MTB (B) | QCD (B) | Grand Total |
+-------------+----------+---------+---------+----------+---------+---------+-------------+
| Bob         |          |       1 |       1 |          |         |         |           2 |
| Alice       |          |         |         |          |       1 |         |           1 |
| Carol       |        1 |       1 |         |        1 |       1 |       1 |           5 |
| Grand Total |        1 |       2 |       1 |        1 |       2 |       1 |           8 |
+-------------+----------+---------+---------+----------+---------+---------+-------------+

我对列名的显示方式很灵活;重要的是,基于的计数Item被分为两组Status。我该怎么做?可以使用数据透视表吗?

Answers:


4

使用数据透视表可以轻松完成此操作。您需要做的就是正确设置它:

  1. 选择用户作为行标签
  2. 选择项目作为您的价值观
  3. 再次选择项目作为列标签
  4. 还要为列标签选择状态。

它将是这样的:

具有2个类别的数据透视

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.