+ Reply to Thread
Results 1 to 5 of 5

Moving Average of separate data sets within the same column

  1. #1
    Registered User
    Join Date
    06-03-2016
    Location
    United States
    MS-Off Ver
    2013
    Posts
    33

    Moving Average of separate data sets within the same column

    Hello,

    I am trying to have a moving average of 3 cells. To set the scene I will describe what my trouble is. I have column A with many different names but most repeat 10 times, some do not repeat. Column B has numbers. I want to take the moving average of 3 cells for person x, but when person y starts I want the moving average to stop and do moving average for person y. So, person x first 3 averages would be N/A and the fourth would average the first 3. Then when person y starts I want their first 3 to be N/A and then start at the fourth. A problem is person z has only 2 data rows so they will not have an average due to lack of data.

    Thanks for the help in advance!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Moving Average of separate data sets within the same column

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  3. #3
    Registered User
    Join Date
    06-03-2016
    Location
    United States
    MS-Off Ver
    2013
    Posts
    33

    Re: Moving Average of separate data sets within the same column

    Attached is an example.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Moving Average of separate data sets within the same column

    In C2, then drag down

    =IF(OR(COUNTIF($A$1:A1,A1)<3,A2<>A1),NA(),AVERAGE(INDIRECT("B"&ROW()-3&":B"&ROW()-1)))

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Moving Average of separate data sets within the same column

    Nice one... One minor tweak to improve the appearance:

    =IF(OR(COUNTIF($A$1:A1,A1)<3,A2<>A1),NA(),TEXT(AVERAGE(INDIRECT("B"&ROW()-3&":B"&ROW()-1)),"0.00"))

+ 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] calculate exponentially weighted moving average (EWMA) in one cell without separate column
    By kmaloney01 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-02-2017, 12:36 AM
  2. Replies: 5
    Last Post: 06-05-2016, 11:32 AM
  3. [SOLVED] Moving multiple columns (8 x sets of 3) with data in separate rows into 3 columns
    By Emmax in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-03-2016, 01:23 PM
  4. Moving Column to Separate Sheet Macro
    By MikeTruth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2012, 05:38 AM
  5. [SOLVED] Two separate charts in one (4 sets of data)
    By Eelko-Jan in forum Excel General
    Replies: 2
    Last Post: 04-26-2012, 10:00 AM
  6. Replies: 1
    Last Post: 01-12-2012, 07:50 PM
  7. [SOLVED] moving average of figures from separate tables
    By Melissa in forum Excel General
    Replies: 15
    Last Post: 01-06-2006, 04:20 AM

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