有效地重新格式化数据布局 [英] Efficiently reformat data layout
问题描述
我有几个Excel电子数据表,其中包含数据布局,如
公司公司1公司2公司3
货币$ YE
1/1/2013 32.68 12 3
1/2/2013 12.5 13 4
1/3/2013 45 45 8
其中基本上是将时间序列数据分组在一起。我需要将最终版面转换为面板数据,如
由于我的观察通常非常大,不实际手动重新格式化。
有没有可以实现这样一个目标的宏代码?
如果需要,打开记录宏。在Excel中,将货币行移开。 反向枢轴(详见此处),将列A上的表排序为Z,切换列B的顺序并按照您的货币指标填写公司名称查询列D。
I have several Excel spreadsheets with data layout like this raw data:
company company1 company2 company3
currency $ Y E
1/1/2013 32.68 12 3
1/2/2013 12.5 13 4
1/3/2013 45 45 8
which basically are time series data grouped together. I need the final layout transformed into panel data, like this wanted panel data:
Since my observations are usually very large, it is not practical manually to reformat it.
Is there a macro code that can achieve such a goal?
Turn on Record Macro if desired. In Excel, move the currency row out of the way. 'Reverse pivot' (as detailed here), sort the Table on Column A to Z, switch the order of Columns B and C and fill Column D with a lookup of the company name against your currency indicators.
这篇关于有效地重新格式化数据布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!