+ Reply to Thread
Results 1 to 3 of 3

Averages Based on Date

  1. #1
    Registered User
    Join Date
    02-11-2004
    Posts
    56

    Averages Based on Date

    I'm have a sheet that uses the =TODAY() command. I'm trying to use this date as a benchmark to get a running 3 month average of some business results. Column A is a list of months (only a few months back so A1:A8) and B1:B8 is the list of results. What I'd like to do is have the formula use the current date to figure out what the prev 3 months are and get the average results. So today, it would give me average of the values for June, July and August. Opening the same sheet on Oct 2nd should provide July, August and Sept results.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi Guilbj2,

    Assuming your month names (January, February, etc.) are in A1:A12 (formatted as text) and your values are in B1:B12, then in B13 (or any other cell) you can try:
    Please Login or Register  to view this content.
    This will lookup the month name and assign its serial number (1 through 12), then compare that with today's month. Finally, it averages the three previous months by dividing the sumproduct by 3.

    Hope that helps.. and maybe someone knows a shorter route to getting the month names converted to numbers. (Of course, if you changed your spreadsheet so that you would put 1/1/07 for January, 2/1/07 for February, etc., and then formatted the cells as Custom, "mmmm", the whole LOOKUP part would go away.)

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by pjoaquin
    ...

    and maybe someone knows a shorter route to getting the month names converted to numbers.
    here's one way...

    =MONTH(--(A1&" 1, 2007"))
    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.

+ 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