+ Reply to Thread
Results 1 to 7 of 7

Max Moving Average Formula REVISON

  1. #1
    Registered User
    Join Date
    05-06-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    5

    Max Moving Average Formula REVISON

    I need to revise the Max Moving average Formulas I have created to allow for an undefined length of the data set and the ability to change the offset (moving average window) of the data.
    Current data set is only 323 rows.
    Attached Files Attached Files

  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
    43,986

    Re: Max Moving Average Formula REVISON

    Set up 3 Named ranges (ColF, ColG, ColH... CTRL-F3 to view edit) along this pattern:

    =$H$3:INDEX($H:$H,MATCH(10^100,$H:$H))

    The formulae then change to look like this:

    =INDEX(ColF,MATCH(MAX(SUBTOTAL(1,OFFSET(G2,ROW(ColG)-ROW(G2),,C2))),SUBTOTAL(1,OFFSET(G2:G3,ROW(ColG)-ROW(G3),,C2)),0))

    and the ranges adjust dynamically to suit your data. see file.
    Attached Files Attached Files
    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
    05-06-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    5

    Re: Max Moving Average Formula REVISON

    Glenn... you are a Rockstar thank you!

    Last question... for: Lowest Moving Average of C (EXCLUDING 0's) how do I exclude ZERO's from this? Meaning... Can the formula look only for a consistent data set where there are NO ZEROS in the data that match the offset ?

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Max Moving Average Formula REVISON

    Maybe try

    =LET(z,H2:H999,n,C4,c,INDEX(z,SEQUENCE(n)+SEQUENCE(,COUNT(z)-n,0)),s,IF(MMULT(SEQUENCE(,n,,0),--(c>0))=n,MMULT(SEQUENCE(,n,,0),c)),MIN(s)/n)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-06-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    5

    Re: Max Moving Average Formula REVISON

    Bo_Ry Super impressed!! Thank you. you nailed it!

  6. #6
    Registered User
    Join Date
    05-06-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    5

    Re: Max Moving Average Formula REVISON

    now Im confused... glen fixed the unlimited row problem with =MIN(SUBTOTAL(1,OFFSET(H2:H3,ROW(ColH)-ROW(H3),,C4))) how do I combine that with your >0 solution?

  7. #7
    Registered User
    Join Date
    05-06-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    5

    Re: Max Moving Average Formula REVISON

    Glen fixed the unlimited row problem with =MIN(SUBTOTAL(1,OFFSET(H2:H3,ROW(ColH)-ROW(H3),,C4))) how do I combine that with your >0 solution?
    Bo_Ry fixed the EXCLUDE 0 issue with =LET(z,H2:H999,n,C8,c,INDEX(z,SEQUENCE(n)+SEQUENCE(,COUNT(z)-n,0)),s,IF(MMULT(SEQUENCE(,n,,0),--(c>0))=n,MMULT(SEQUENCE(,n,,0),c)),MIN(s)/n)

    Thank you both for your contributions!

    Now I am stuck with two independent solutions that have to be merged together? suggestions?
    Last edited by Flyboy1969; 05-10-2022 at 11:53 AM.

+ 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. find file from a folder with highest revison--resolved
    By var in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2015, 10:08 PM
  2. Replies: 1
    Last Post: 10-20-2014, 03:20 PM
  3. help with moving average formula
    By fiat124cc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-01-2013, 10:43 PM
  4. [SOLVED] Formula Moving Average
    By calan in forum Excel General
    Replies: 11
    Last Post: 06-12-2012, 01:35 PM
  5. Moving Weighted Average formula
    By magickingdl in forum Excel General
    Replies: 2
    Last Post: 09-29-2008, 01:59 PM
  6. Excel ? Formula for moving average
    By TAL in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-09-2006, 11:40 AM
  7. [SOLVED] Moving Average Formula Problem
    By [email protected] in forum Excel General
    Replies: 3
    Last Post: 03-21-2006, 07:55 PM

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