+ Reply to Thread
Results 1 to 4 of 4

average calculation, while matching years and regioncodes

  1. #1
    Registered User
    Join Date
    10-02-2022
    Location
    Netherlands
    MS-Off Ver
    2021
    Posts
    1

    average calculation, while matching years and regioncodes

    Hi all,

    I have a dataset which has regioncode's, years and growthrates (from 2014-2018). The original set is about 10.000 rows, but i've attached a simplified 14.

    Question:
    I would like add a new column which calculates the average growth rate from 2014-2018 for the given observation, matching with the correct regioncode:

    1: (2014+2015+2016+2017+2018)/5

    In the dataset (see below), I have shown the preferred result. So if the observation has a year of 2014-2018, it should show the average. If the year is 2012 or 2013, the cell should be empty.

    example.xls

    I have tried some combination of averageifs( ), but I could not make it work.

    Best,

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: average calculation, while matching years and regioncodes

    You better added an xlsx file, since you use 2021.

    With the data in a table.

    Used formula to change text into value for the year.

    With a formula to determine the criteria.

    After that with a Pivot table.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,998

    Re: average calculation, while matching years and regioncodes

    E2=IF($A2<>"",IF($C2>$G$1,AVERAGEIFS($D$2:$D$100,$C$2:$C$100,">"&$G$1,$B$2:$B$100,B2,$A$2:$A$100,A2),"empty"),"")

    Copy down

    type year in cell G1
    Attached Files Attached Files

  4. #4
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,962

    Re: average calculation, while matching years and regioncodes

    Cell E2 array formula , Drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. leap years and date calculation
    By Alaxus in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-16-2020, 09:34 AM
  2. Matching two worksheet for different years.
    By Calluum2 in forum Excel General
    Replies: 4
    Last Post: 11-09-2014, 02:07 PM
  3. [SOLVED] Average by month for all years
    By h0ps in forum Excel General
    Replies: 5
    Last Post: 11-01-2013, 06:35 AM
  4. [SOLVED] Calculation of years and months
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-16-2013, 12:50 PM
  5. [SOLVED] Years of Service for Benefit Calculation
    By monid78 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2013, 11:20 AM
  6. Average between Years
    By excelgrrl in forum Excel General
    Replies: 1
    Last Post: 01-23-2009, 07:24 PM
  7. Years of Service Calculation
    By JS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2006, 02:55 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