如何将重复的行转换为列? [英] How to pivot duplicate rows to columns?

查看:52
本文介绍了如何将重复的行转换为列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很难弄清楚如何将具有重复行的多列数据集转换为唯一列.

我已经进行了研究,并发现了一些VBA脚本来执行此操作,但是当我进行计数以确认其正确旋转并最终一遍又一遍地添加重复的列(名称/评级年份)时,会导致数据丢失./p>

有人有什么想法吗?我会做一个数据透视表,但是我无法在数据透视表中显示实际评级值,只能显示总和/计数/平均值.等等...

解决方案

您可以在powerquery中轻松地做到这一点.

  1. 突出显示所有数据,然后插入>添加表格
  2. 数据标签>从表格中获取数据
  3. 突出显示右两列>枢轴列
  4. 将等级定为值
  5. 高级选项>不要汇总
  6. 找到并将空值替换为空
  7. 保存并关闭

having a hard time figuring out how to pivot a multi-column data set with duplicate rows into unique columns.

I have done research and found some VBA scripts to do this, but it is resulting in data missing when I do counts to confirm it pivoted correctly and ends up adding in duplicate columns (name/ rating year) over and over.

Anyone have any ideas? I'd do a pivot table, but I can't display the actual rating values in a pivot, only a sum/count/avg. etc...

解决方案

You can do this easily in powerquery.

  1. Highlight all your data, then insert>add table
  2. data tab>get data from table
  3. highlight right two columns>pivot columns
  4. rating level as values
  5. advanced options>don't aggregate
  6. find and replace null with nothing
  7. save and close

这篇关于如何将重复的行转换为列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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