+ Reply to Thread
Results 1 to 4 of 4

Effectively rearrange large dataset

  1. #1
    Registered User
    Join Date
    08-02-2016
    Location
    Utrecht
    MS-Off Ver
    2010
    Posts
    14

    Effectively rearrange large dataset

    Dear member,

    I am trying to effectively rearrange my Market-to-Book ratio data so that I can easily paste it into Stata and use it for my regression analysis. Currently, Datastream provided me with output in the following way:

    Hulp.png

    I.e. in the first column it shows all years and then every new collumn is the output per company. However, I need to rearrange my data so that it gives the company name in the first collumn, the year in the second and then for that year the respective value in the third collumn. A short example is:


    NAME YEAR MBTV
    BARCLAYS 2004 0.26
    BARCLAYS 2005 0.28
    BARCLAYS 2006 0.29
    BT GROUP 2004 0.25
    BT GROUP 2005 0.29
    BT GROUP 2006 0.31
    BT GROUP 2007 0.12


    etc.

    How can I effectively rearrange this (due to a dataset of approximately 40K companies with 14 firm-year observations each)?

    Thank you for your help!!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Effectively rearrange large dataset

    See attached: sample data in column A:C with output in E:G

    in E2

    =INDEX($B$1:$C$1,INT((ROWS($1:1)-1)/14)+1)

    in F2

    =MOD(ROWS($1:1)-1,14)+2004

    in G2

    =INDEX($B$2:$Z$15,MOD(ROWS($1:1)-1,14)+1,MATCH($E2,$B$1:$Z$1,0))
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-02-2016
    Location
    Utrecht
    MS-Off Ver
    2010
    Posts
    14

    Re: Effectively rearrange large dataset

    Thank you! That works!
    Last edited by DanielZig; 06-15-2017 at 07:59 AM.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,152

    Re: Effectively rearrange large dataset

    Set Calculation to Manual before inserting the formulae. Then res-set to Automatic.

    Formulas==>Calculation Options

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to find large amount number/letter sequences effectively from a table
    By keitto in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-30-2015, 07:43 AM
  2. Large dataset sorting help
    By kjibbs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2014, 12:35 PM
  3. Replies: 3
    Last Post: 01-23-2014, 10:13 AM
  4. [SOLVED] Finding ALL CAPS in large dataset
    By renee705 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2012, 02:35 PM
  5. [SOLVED] Graphing a large dataset
    By CTM2012 in forum Excel General
    Replies: 6
    Last Post: 06-18-2012, 03:48 PM
  6. Graphing a large dataset
    By CTM2012 in forum Excel General
    Replies: 9
    Last Post: 06-18-2012, 10:20 AM
  7. Delete rows from a LARGE dataset
    By trillium in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2011, 05:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1