如何将部分Excel数据转换为列以获得所需的输出? [英] How can I turn part of the Excel data to columns to get a desired output?

查看:118
本文介绍了如何将部分Excel数据转换为列以获得所需的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如-说我有以下格式的数据-

For eg - Say I have data in the following format -

当前格式 < br>

Current Format

为了方便使用,我需要将数据格式化为以下格式-

I would need the data to be formatted in the following format for ease of use -

必需格式

Required Format

当然,数据包含更多的记录-我正在寻找一种简单的方式来对大型数据集以这种方式转置数据。

Of course the data contains a lot more records - I'm looking for an easy way to transpose data in this way for large sets of data.

任何帮助将不胜感激:)

Any help will be appreciated :)

推荐答案

使用PowerQuery非常容易。它是为Excel 2016内置的,并且是2010年至2013年之间免费提供的版本插件。

This is very easy with PowerQuery. It is inbuilt for Excel 2016 and a freely available add in for Version from 2010 to 2013.

您需要将数据设置为表格,但第一行不包含文本案例数(Ctrl + T,同时打开窗口以创建表)

You would set your data up as a table excluding the first row which contains the text Number of Cases (Ctrl + T whilst bring up window to create table)

然后从数据选项卡(Excel 2016)或Powerquery选项卡(早期版本)中从表中选择数据,然后使用新创建的表作为源。

Then from the data tab (Excel 2016) or the Powerquery tab (earlier versions) select data from table and use your newly created table as source.

突出显示最后3列,然后右键单击>取消透视列

Highlight the last 3 columns and right click > unpivot columns

双击标题部分,然后将属性重命名为类型,将值重命名为案例数

Double click in headers section and rename Attribute as Type and Value as Number of Cases

左上方选择关闭并加载到

Top left select close and load to

选择表并加载到新工作表(或现有工作表)

Select table and load to new worksheet (or existing)

查看结果

这篇关于如何将部分Excel数据转换为列以获得所需的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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