+ Reply to Thread
Results 1 to 3 of 3

Averaging Most Recent Contiguous Run of Cells

  1. #1
    Registered User
    Join Date
    08-31-2012
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    2

    Averaging Most Recent Contiguous Run of Cells

    I am creating a production schedule for a local micro brewery in town. They produce a handful of beers year round, continuously, and other beers during certain times of the year only. I have a usage table where we plot each week's use for each type of beer.

    My problem arises when I try to find the average use for the most recent seasonal run of beers. To clarify, the seasonal beers will have data for several weeks in a row, and then several weeks of blank cells, followed by another group of weeks with data. I need to be able to reference the most recent group of cells to run calculations (like average use, growth rate etc). For instance, they brew a wheat beer during the summer months only. So we will have data from May 1 to Sept 1 for example, and blank cells for the remainder of the year. The brewery wants to see what last summer's average use was, and the summers prior to that should not be included (or at least given less weight).

    So how do I determine that most recent run of weeks? I've tried areas() but that does not seem to do what I'm intending. I'm having trouble wrapping my head around what equations I should use for this. Thanks in advance for any help.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Averaging Most Recent Contiguous Run of Cells

    Say your data is in A2:A26 (with or without blanks at the bottom), then try:

    =AVERAGE(INDEX(A2:A26,MATCH(2,INDEX(1/(A2:INDEX(A2:A26,MATCH(10^10,A2:A26))=""),0))+1):INDEX(A2:A26,MATCH(10^10,A2:A26)))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-31-2012
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Averaging Most Recent Contiguous Run of Cells

    This works perfect. Thank you so much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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