+ Reply to Thread
Results 1 to 5 of 5

Min/Max Average based upon date

  1. #1
    Registered User
    Join Date
    12-23-2010
    Location
    Oxnard, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Min/Max Average based upon date

    Hello Everyone!

    Tried searching the forums but came up dry, hope I didn't miss the discussion!

    Please bear with me during my description of the problem...

    I have a column of numbers (referring to calendar dates, let's say they are A2 through A33). In B column, I have average formulas pulling data from another sheet. In C I have the MIN formula to get the min of that day and in D the MAX. I believe I got the MIN/MAX set up correctly as well as having the formula check if today's date matches the number in column A and if so, calculate the numbers. The issue I'm having is retain those averages once tomorrow comes. Here are the formulas I'm using:

    Please Login or Register  to view this content.
    Thank you for any help you may be able to provide!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Min/Max Average based upon date

    Hi,

    Well (trivially) you could just copy and paste special values before tomorrow comes.

    Of course you would no longer have any formulae, but I'm not clear as to what is your ultimate aim. Are you trying to retain a history of each day as you progress through the future, just the last day or some other requirement?

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-23-2010
    Location
    Oxnard, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Min/Max Average based upon date

    That is exactly what I suggested, but of course my boss is lazy and he wants this done automatically!

    Yes, I'm trying to retain all the data for the entire month.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Min/Max Average based upon date

    Hi,

    In that case you will need a macro. You need to determine what event should kick off this process and since the results will change every day the file is first opened the logical event is the Workbook_Open event. So go to the Visual Basic Environment and in the Workbook Object Open event enter the following macro.


    Please Login or Register  to view this content.
    In B1 of the worksheet enter the formula =TODAY(). This is required to prevent the updating if the workbook is opened more than once on the same day.

    The macro inserts four new columns and then copies the values from B1:E33 to F1. If the workbook is opened again on the same day the If test which compares B1 to F1 will result in False and hence the macro will not run.

    Hope this helps.

  5. #5
    Registered User
    Join Date
    12-23-2010
    Location
    Oxnard, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Min/Max Average based upon date

    Hey I was waiting to thank you until I could try it out and see if it performed to my boss' specifications... well of course he changed his mind and went a different route which I was able to help him with so I just want to thank you very much for your time and effort helping me out!

+ 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