+ Reply to Thread
Results 1 to 4 of 4

Calculate averages in panel data file

  1. #1
    Registered User
    Join Date
    05-01-2015
    Location
    Barcelona
    MS-Off Ver
    Excel 2013
    Posts
    4

    Calculate averages in panel data file

    Hi,

    I have panel data in Excel and need to calculate the average value of sales for every firm. It thus looks like this:

    firm year sales average
    1 1991 10
    1 1992 12
    1 1993 34
    1 1994 19
    1 1995 28
    2 1991 51
    2 1992 92
    etc.

    I want to calculate the average for every firm and put it in each of the boxes, something like this:

    1 1991 10 20.6
    1 1992 12 20.6
    1 1993 34 20.6
    1 1994 19 20.6
    1 1995 28 20.6

    Is there a way to easily accomplish this?

    Thanks in advance,
    hahaha1241

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,914

    Re: Calculate averages in panel data file

    How about this in D1, copied down?

    =AVERAGEIF(A$1:A$7,A1,C$1:C$7)

    Expand the ranges to suit.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-01-2015
    Location
    Barcelona
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Calculate averages in panel data file

    Quote Originally Posted by AliGW View Post
    How about this in D1, copied down?

    =AVERAGEIF(A$1:A$7,A1,C$1:C$7)

    Expand the ranges to suit.
    Thank you! I actually was playing around with the AVERAGEIF function already but could not make it work.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,914

    Re: Calculate averages in panel data file

    You're welcome!

    It's possible you didn't fix the lookup ranges before copying down: that's what the dollar sign does.

+ 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. Calculate and compare rolling averages with daily data entry?
    By iamchipdouglas in forum Excel General
    Replies: 8
    Last Post: 12-26-2014, 01:31 PM
  2. Trying to make file that adds and averages important gas mileage/cost data
    By FlyinIron406 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-17-2014, 07:37 AM
  3. [SOLVED] Too wide File Tab, message panel and context menus
    By Plavozont in forum Excel General
    Replies: 1
    Last Post: 01-22-2014, 12:33 AM
  4. Replies: 3
    Last Post: 10-01-2013, 05:05 AM
  5. Calculate monthly, quarterly, and yearly averages from daily data
    By jhound in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-27-2013, 11:16 AM
  6. Replies: 1
    Last Post: 05-02-2008, 10:41 AM
  7. Replies: 2
    Last Post: 07-12-2007, 10:34 AM

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