+ Reply to Thread
Results 1 to 9 of 9

Rolling Average when Unhiding Cells

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    40

    Rolling Average when Unhiding Cells

    I have a table in Cells A4:X50. I will hide the cells that are not relevant (based on date).

    I would like it to calculate an average on the cells that are showing and have it change when I unhide more cells.

    The pink cells are the ones I would like to calculate an average on.

    running average help.xlsx

  2. #2
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Rolling Average when Unhiding Cells

    Sorry the cells actually go through BK50 when unhidden.

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Rolling Average when Unhiding Cells

    No one has any ideas?

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

    Re: Rolling Average when Unhiding Cells

    With subtotal.

    See the attached file.

    I think you get better results with an pivot table.
    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.

  5. #5
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: Rolling Average when Unhiding Cells

    Hi dianaschar

    Because your file includes links to external files, the data is unusable. However, I have written the following macro which will do what you want.

    Please Login or Register  to view this content.

    To enter the code Press Ctrl+F11. Insert. Module. Coyp the above code there. In order to run it, press Alt+F8 and run YTDaverage.

    You will need to change the type of file to a macro enabled file (ending ".xlsm") in order to save it.

    Let me know if it works OK for you.

    Regards
    Alastair

  6. #6
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Rolling Average when Unhiding Cells

    That worked! Is there a way I can make it less relative to active cell though and have it work no matter where the active cell is?

  7. #7
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: Rolling Average when Unhiding Cells

    erm... No.

    That is to say that it is not depend on where you are when you run it.

    The first line of the macro starts the routine from BL4, no matter what cell is active.

    If you check the first line and are still having problems, let me know what is happening and I will try to sort it.

    Regards
    Alastair

  8. #8
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Rolling Average when Unhiding Cells

    Oh gotcha, nevermind.

    Thank you very much.

  9. #9
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: Rolling Average when Unhiding Cells

    Glad to have been able to help, but do I detect that there is something else that can be improved?

    Regards
    Alastair

+ 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