+ Reply to Thread
Results 1 to 10 of 10

Finding date in which the average for trailing 6 months is >= x

  1. #1
    Registered User
    Join Date
    04-29-2021
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    6

    Finding date in which the average for trailing 6 months is >= x

    I'm trying to use a single formula that allows me to return the first date where the average of the trailing 6 values is greater than x. The two ranges being used are a horizontal range of dates (month by month) and a horizontal range of values. The difficulty with this formula is that the "trailing 6" criteria requires a different sized range to be used. I've tried using minifs(, averageifs, and offset together but can't get anything to work. Any ideas?

    EDIT: Please see attached excel sheet for reference. Sorry for the ambiguity... from a glance it's actually a very simple problem I'm trying to solve for. However, I just can't get the "trailing 6" criteria to work with any functions. FYI I'm trying to this WITHOUT a helper row. Happy to answer questions if this is still too vague.
    Attached Files Attached Files
    Last edited by Robertcm99; 02-09-2023 at 11:08 AM.

  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,054

    Re: Finding date in which the average for trailing 6 months is >= x

    Too many potentially ambiguous phrases there!



    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    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
    04-29-2021
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Finding date in which the average for trailing 6 months is >= x

    Thank you for your patience and instructions. I have added an excel file to the post.

  4. #4
    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,054

    Re: Finding date in which the average for trailing 6 months is >= x

    Are you interested in a situation where the first average >70 occurs after 4 months... e.g.

    60,60,66,150

    This formula assumes thta you are NOT interested in getting that value, as it does not meet the 6 month criterion.

    =LET(N,6,A,COLUMNS(B2:R2)-(N-1),B,TRANSPOSE(DROP(B1:R1,,N-1)),C,MAP(SEQUENCE(A),LAMBDA(X,AVERAGE(INDEX(2:2,1+X):INDEX(2:2,N+X)))),D,HSTACK(B,C),TRANSPOSE(TAKE(FILTER(D,INDEX(D,,2)>70),1)))
    Attached Files Attached Files

  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,054

    Re: Finding date in which the average for trailing 6 months is >= x

    If you DO want the first average >70, even if it occurs in < 6 months, then this will do that.
    Attached Files Attached Files

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Finding date in which the average for trailing 6 months is >= x

    Alternative solution for Ex2016 or earlier

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  7. #7
    Registered User
    Join Date
    04-29-2021
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Finding date in which the average for trailing 6 months is >= x

    Thanks a million. Yall are amazing!

  8. #8
    Registered User
    Join Date
    04-29-2021
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Finding date in which the average for trailing 6 months is >= x

    Thank you sir! How would you change this formula to reflect "forward 6" while not including "current" month in the "forward 6"?

  9. #9
    Registered User
    Join Date
    04-29-2021
    Location
    Texas, USA
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Finding date in which the average for trailing 6 months is >= x

    Quote Originally Posted by bebo021999 View Post
    Alternative solution for Ex2016 or earlier

    Please Login or Register  to view this content.

    Thank you sir! How would you change this formula to reflect "forward 6" while not including "current" month in the "forward 6"?

  10. #10
    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,054

    Re: Finding date in which the average for trailing 6 months is >= x

    Quote Originally Posted by Robertcm99 View Post
    Thank you sir! How would you change this formula to reflect "forward 6" while not including "current" month in the "forward 6"?
    If you were talking to me:

    =LET(N,6,A,COLUMNS(B2:R2)-(N-1),B,TRANSPOSE(DROP(B1:R1,,N-1)),C,MAP(SEQUENCE(A),LAMBDA(X,AVERAGE(INDE

    in V1, and in V2:

    =LET(A,B2:R2,B,TRANSPOSE(B1:R1),C,6,D,COLU

    change to whatever you want. It returns the average of that number of values (in V2, or fewer if <n are available.

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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] Finding average of previous months
    By achu3186 in forum Excel General
    Replies: 6
    Last Post: 05-23-2021, 07:48 AM
  2. Trailing 12 Months (TTM) Formula For Sales Sheet
    By striker_rage in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-01-2014, 02:20 PM
  3. formulas for trailing twelve months (two rounds)
    By ammartino44 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-31-2013, 01:35 PM
  4. trailing twelve months formula
    By amartino44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-17-2013, 02:28 PM
  5. Finding the average re-order date in terms of months
    By sanjay.wagjiani in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-10-2013, 11:31 AM
  6. Sum Trailing 12 Months
    By sabunabu in forum Excel General
    Replies: 2
    Last Post: 06-03-2008, 09:08 AM
  7. Trailing 12 Months Formula
    By CPimental in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-09-2008, 11:30 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