+ Reply to Thread
Results 1 to 2 of 2

Reshaping data into panel data format

  1. #1
    Registered User
    Join Date
    02-23-2018
    Location
    Portugal
    MS-Off Ver
    2016
    Posts
    1

    Reshaping data into panel data format

    Hello everyone!

    I'm currrently doing my master's dissertation (in Finance) and would like to ask you for some help regarding the shaping of the data I've collected. I'm doing a panel data analysis and therefore have data for several companies across time.

    Attached goes a sample file so you can better visualise how I've collected the data and how i want to reshape it. The green tabs are some of the variables I'll use in my analysis, with each tab having info on the respective variable for several companies across several years.

    I need to take this data and reshape it into panel data form, as in the first tab (variables in columns and companies and years in lines). I'm looking for a way (either through formulas, macros,...) to do that relatively fast, given that doing it by hand (copying and pasting with transpose, which is the first idea I came up with) is simply not feasible time wise.

    I'd really appreciate any help you could give me, since it'll probably save me a lot of time and trouble.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,673

    Re: Reshaping data into panel data format

    Hello migftg95, and Welcome to Excel Forum.
    Perhaps the attached will be of some help.
    Column A is populated using: =INDEX('Excess Return'!C$3:C$86,COUNTIFS(C$3:C3,C$3))
    Column B (un-merged) is populated using: =IF(C3=2010,INDEX('Excess Return'!B$3:B$87,MATCH(A3,'Excess Return'!C$3:C$87,0)),"")
    Column C, starting from row 4 is populated using: =IF(C3=2016,2005,C3+1)
    Columns D:F are populated using array entered formulas* similar to:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER, before copying. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Note: I reduced the size of the data sheets to the first 87 rows. Hopefully I left enough so that you can see how this can be applied to the entire data set.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Help with building a panel data format
    By HDR321 in forum Excel General
    Replies: 3
    Last Post: 05-06-2017, 12:33 PM
  2. Reshaping data excel to panel data
    By bobalongis in forum Excel General
    Replies: 4
    Last Post: 11-24-2016, 07:01 AM
  3. [SOLVED] Change large table into panel data format
    By barbet in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-05-2015, 01:46 AM
  4. I need help with changing my data set to panel data format!
    By Robbin1234 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-14-2013, 08:55 AM
  5. [SOLVED] Conversion into panel data format
    By tulasiram in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2013, 03:54 AM
  6. convert data from cross section to panel format
    By diquez in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-21-2012, 12:58 PM
  7. Reshaping Data
    By GQuinn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2010, 11:41 PM

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