+ Reply to Thread
Results 1 to 9 of 9

Moving average of a moving average in the same cell

  1. #1
    Registered User
    Join Date
    09-15-2008
    Location
    England
    Posts
    4

    Moving average of a moving average in the same cell

    Hi.

    I have a large spread of data for example cells A1 - A100.

    I wish to take a moving average of cells A1-A100 and place this data in cells B1-B100. I then want to take a moving average of the results in cells B1-B100and place them in the same cell arrangement, effectively taking a moving average of a moving average within the same cell arrangement.

    Depending upon the frequency spread of my data i may need to do this up to 10 times and place the 10th moving average in the same column as the first moving average replacing the data the original moving average data.

    Any help would be much appreciated!

    Thanks in advance,

    Phil

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Moving average

    A1-A100 and place this data in cells B1-B100
    Moving average starts after taken the average of n samples, so what is the value of B1 .. Bn-1?
    Please Login or Register  to view this content.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Registered User
    Join Date
    09-15-2008
    Location
    England
    Posts
    4
    The value of cell B1 is the same as the value as A1. The first few values do not really matter in this case, it is only when about twenty values in that the data becomes important.

    My first few bits of data are as follow:

    A1 = 68.066
    A2 = 69.040
    A3 = 70.215
    A4 = 71.777
    A5 = 74.316
    A6 = 90.332
    A7 = 81.738
    A8 = 75.293
    A9 = 90.918
    A10 = 87.201

    The data then tends to zero over the next 90 values.

  4. #4
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    Is this what you are looking for?
    B1: =AVERAGE(A$1:A1) and copy down, and right
    After the 10th column, Copy all values in column 10 and Paste special as Values to replace the values in column A
    //Ola

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Moving average of a moving average in the same cell

    This code will make it semi-automatic
    Please Login or Register  to view this content.
    If you need additional help, Please reply
    Last edited by rwgrietveld; 09-15-2008 at 05:53 AM.

  6. #6
    Registered User
    Join Date
    09-15-2008
    Location
    England
    Posts
    4
    How do i implement this as i have pretty much no idea about macro's.

    Thanks.

  7. #7
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    1. Copy the code
    2. Press the Alt + F11 key
    3. Paste

    If you get any problems, try to attach the file (or sample file).
    Ola

  8. #8
    Registered User
    Join Date
    09-15-2008
    Location
    England
    Posts
    4
    Ok, i have attached an example of the data i have.

    If you plot column A against column B (crank angle vs pressure) you will see that about +3.8 crank angle there is a large oscillation. I wish to smooth this oscillation.

    The way i do this is by taking a 5 point moving average either side of the value i am trying to calculate. If you look in cell C921 you will see the formula i have used. From cells C1 - C920, these are the same values as B1 - B920, i have copied and pasted. This is not a problem.

    So, the moving average formula is then filled down the rest of the rows to the end of the data. What i have done then is taken a second 5 point moving average of the data in column C and calculated it in D and then to calculate the 3rd moving average, used the data in column D and so on.

    What i would like to do is just perform this in one column so that the 2nd moving average is layed over the 1st and the third moving average is layed over the second etc. From the graph i have plotted you can see that after about 5 or 6 consecutive moving averages, the curve becomes smooth.

    I hope this post has made sense. If not please let me know.

    I would be so grateful if someone could help.

    Thanks.
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: moving average

    Play with this.
    Attached Files Attached Files

+ 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. Code that takes an average of cell values
    By gshock in forum Excel General
    Replies: 2
    Last Post: 04-16-2008, 05:15 PM
  2. moving the 2nd word in a cell in front of the first word
    By Lukas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2007, 09:26 PM
  3. using cell content to reference a worksheet tab name in second workbook
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2007, 09:32 AM
  4. moving between cell not working properly
    By jowen001 in forum Excel General
    Replies: 1
    Last Post: 08-24-2007, 12:40 PM
  5. Replies: 0
    Last Post: 08-22-2007, 04:43 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