数据透视表显示值,而不是值的总和 [英] PivotTable to show values, not sum of values

查看:381
本文介绍了数据透视表显示值,而不是值的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示一个数据透视表,并为它显示实际值,每行一个,而不是值的总和。例如

 名称Jan Feb Mar Apr 
Bob 12 10 4
3 5
詹姆斯2 6 8 1
15

等。



我的起点有三列: Name Value Month



这是否可以而不必做一些完全不同的事情?

解决方案

我担心这可能会很长一段时间,但可能取决于您的数据集有多大 - 可能超过四个月。例如

假设您的数据位于 ColumnA:C 中,并在第1行中有列标签,而且该月份格式为 mmm (这最后是为了便于排序):


  1. 按照名字排序数据,然后按月份

  2. 输入 D2 = IF(AND(A2 = A1,C2 = C1),D1 + 1,1) (一种处理什么是棘手问题的方法

  3. 创建一个数据透视表A1:D(最后占用的行号)

  4. 中插入F1

  5. 截图中的布局。



我希望这对您的需求是足够的,因为透视表应自动更新(提供的范围是适当的)以响应刷新的其他数据。如果没有(你是hardmastermaster),请继续,但请注意,每次源数据更改时,都需要重复以下步骤。


  1. 复制数据透视表和粘贴特殊/值到,例如 L1

  2. 删除顶部复制范围的行

  3. 将新单元格插入 L1 并向下移动。

  4. 键名称 L1

  5. 过滤复制的范围,对于 ColumnL ,选择行标签和数值。

  6. 删除 L2的内容:L(最后选定的单元格)

  7. 删除带有移动单元格的复制范围中的空白行(最好通过添加统计所有12个月的列)。
    希望结果应该以黄色突出显示。

很高兴进一步解释/再试一次(我还没有真正测试这个)如果不适合。



编辑(为了避免上述步骤的第二步,方便更新源数据更改)



.0。在第一步之前,在顶部添加一个空白行,并移动 A2:D2
up。

.2。相应调整单元格引用(在 D3 = IF(AND(A3 = A2,C3 = C2),D2 + 1,1)

.3。从创建数据透视表A:D



。 6.覆盖行标签名称

.7。数据透视表工具,设计,报告布局,以表格形式显示并排序行和列A> Z。

.8。隐藏 Row1 ColumnG 和显示(空白)

的行和列





步骤.0。和.2。不需要编辑如果数据透视表与源数据处于不同的表格中(推荐)。



步骤.3。在编辑中是一种变化,以简化扩展源的后果数据集,然而将(空白)引入到数据透视表中,如果被隐藏可能需要在刷新时进行调整,那么每次改变源数据范围可能会更好: PivotTab le工具,选项,更改数据源,更改数据源,选择一个表或范围)。在这种情况下,复制而不是移动到.0。


I'm wanting to display a pivot table and for it to show me the actual values, one on each row, rather than a sum of the values. E.g.

Name    Jan   Feb   Mar   Apr
Bob     12    10          4
        3     5      
James   2     6     8     1
                    15

etc.

My starting point is having three columns: Name, Value and Month.

Is this possible without having to do something completely different?

解决方案

I fear this might turn out to BE the long way round but could depend on how big your data set is – presumably more than four months for example.

Assuming your data is in ColumnA:C and has column labels in Row 1, also that Month is formatted mmm(this last for ease of sorting):

  1. Sort the data by Name then Month
  2. Enter in D2 =IF(AND(A2=A1,C2=C1),D1+1,1) (One way to deal with what is the tricky issue of multiple entries for the same person for the same month).
  3. Create a pivot table from A1:D(last occupied row no.)
  4. Say insert in F1.
  5. Layout as in screenshot.

I’m hoping this would be adequate for your needs because pivot table should automatically update (provided range is appropriate) in response to additional data with refresh. If not (you hard taskmaster), continue but beware that the following steps would need to be repeated each time the source data changes.

  1. Copy pivot table and Paste Special/Values to, say, L1.
  2. Delete top row of copied range with shift cells up.
  3. Insert new cell at L1 and shift down.
  4. Key 'Name' into L1.
  5. Filter copied range and for ColumnL, select Row Labels and numeric values.
  6. Delete contents of L2:L(last selected cell)
  7. Delete blank rows in copied range with shift cells up (may best via adding a column that counts all 12 months). Hopefully result should be as highlighted in yellow.

Happy to explain further/try again (I've not really tested this) if does not suit.

EDIT (To avoid second block of steps above and facilitate updating for source data changes)

.0. Before first step 2. add a blank row at the very top and move A2:D2 up.
.2. Adjust cell references accordingly (in D3 =IF(AND(A3=A2,C3=C2),D2+1,1).
.3. Create pivot table from A:D

.6. Overwrite Row Labels with Name.
.7. PivotTable Tools, Design, Report Layout, Show in Tabular Form and sort rows and columns A>Z.
.8. Hide Row1, ColumnG and rows and columns that show (blank).

Steps .0. and .2. in the edit are not required if the pivot table is in a different sheet from the source data (recommended).

Step .3. in the edit is a change to simplify the consequences of expanding the source data set. However introduces (blank) into pivot table that if to be hidden may need adjustment on refresh. So may be better to adjust source data range each time that changes instead: PivotTable Tools, Options, Change Data Source, Change Data Source, Select a table or range). In which case copy rather than move in .0.

这篇关于数据透视表显示值,而不是值的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆