+ Reply to Thread
Results 1 to 5 of 5

Macro to calculate and display the average

  1. #1
    Registered User
    Join Date
    02-20-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    7

    Macro to calculate and display the average

    Hi all,

    I have an excel sheet that has two columns (date and total records) and these records go back to 6 months. Each day there will be a new row with a date in first and total record in second column. I'm currently using below macro to compare today's record against the average of the previous 7 days. Since the data goes back to 6 months and it does not give me a clear vision of the changes, I wanted to change the macro to compare today's records against previous four weeks. If today is Monday, I wanted to take the average of past four Mondays (not everyday). I was wondering if someone can help me to modify this macro.

    Please Login or Register  to view this content.
    Thanks in advance.
    Last edited by pike; 02-21-2011 at 02:26 AM. Reason: add code tags for newbie

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to calculate and display the average

    hi, suryab, it would be nice to see sample workbook

  3. #3
    Registered User
    Join Date
    02-20-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Macro to calculate and display the average

    Hi Watersev,

    Thanks for your reply. The data is in this format and goes all the way back upto 6 months.

    Date Records

    14/02/2011 2629925
    15/02/2011 2603934
    16/02/2011 2548989
    17/02/2011 2597713
    18/02/2011 2566184
    19/02/2011 1154049

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to calculate and display the average

    hi, Suryab, I would suggest to use formula that will give you averages:
    1. 1 week to date
    2. 2 weeks to date
    3. 3 weeks to date
    4. 4 weeks to date
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-20-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Macro to calculate and display the average

    Hi Watersev,

    Thanks for your time and looking into this. The macro code I've quoted above is a part of a larger macro that does many other things so using the formula may be little harder to accommodate. I wanted to modify the macro instead if that is possible.

    Thank you.

+ 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