Efficiently reformat data layout

余生颓废 提交于 2019-12-01 13:27:49

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/33790370/efficiently-reformat-data-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!