+ Reply to Thread
Results 1 to 8 of 8

Help Calculating A Simple Moving Average

  1. #1
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Help Calculating A Simple Moving Average

    Greetings,
    I need help calculating a simple moving average. I can formulate the basic formula of adding up all of the values and then dividing. The problem is I’d like some of the values not to be counted when calculated and for this I need a formula. All of the values with an “X” next to them need to be skipped. This is a 100 period moving average so it would be the sum of 100 values divided by 100 to get the SMA.

    The only difference as stated is I want every value with an “X” next to it to be skipped and not included in the 100 values used to calculate the SMA. A spreadsheet is attached giving an example of what I need and more information. Thank you in advance for any and all help.
    Attached Files Attached Files
    Last edited by artiststevens; 04-13-2013 at 11:41 PM.

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

    Re: Help Calculating A Simple Moving Average

    Maybe with an pivot table.

    See the attached file.
    Attached Files Attached Files
    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 Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Help Calculating A Simple Moving Average

    Quote Originally Posted by oeldere View Post
    Maybe with an pivot table.

    See the attached file.
    Thank you for the help oeldere. I'm not very familiar with pivot tables and I need a formula because I'm calculating other formulas on the same sheet, so a formula would be more ideal.

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

    Re: Help Calculating A Simple Moving Average

    With sumproduct.

    See the attached file (the orange cells).
    Attached Files Attached Files

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Help Calculating A Simple Moving Average

    Do you mean?

    =AVERAGE(IF(D2:D114<>"X",C2:C114))

    Array formula.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Help Calculating A Simple Moving Average

    Hello Fotis,
    Thank you for the help! The array worked. I think it needs to be changed slightly. It appears to be rounding the numbers down.

    Manual Array
    1.0422 1.0421
    1.0422 1.0422
    1.0423 1.0422
    1.0424 1.0423
    1.0424 1.0423
    1.0426 1.0425
    1.0427 1.0426
    1.0429 1.0428
    1.0430 1.0429
    1.0432 1.0431
    1.0433 1.0433
    1.0435 1.0434
    1.0436 1.0435
    1.0438 1.0437
    1.0439 1.0438
    1.0440 1.0439
    1.0441 1.0440

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Help Calculating A Simple Moving Average

    Not sure that i am able to follow you...

    Do you put this formula to a specific cell and copied down?

  8. #8
    Forum Contributor
    Join Date
    10-05-2010
    Location
    CA
    MS-Off Ver
    Excel 365
    Posts
    539

    Re: Help Calculating A Simple Moving Average

    I was able to make it work. Thank you Fotis.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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