+ Reply to Thread
Results 1 to 8 of 8

Excel 2007 : Column to formulate an average of the current four dates

  1. #1
    Registered User
    Join Date
    09-01-2011
    Location
    Wayne, PA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Column to formulate an average of the current four dates

    I have my dates on a row and I have the data under each date that pertains to it. Trying to figure out the formula so that the cell will only pick up the four most current dates even as I continue to enter data going forward. Any suggestions.


    jmarrer0
    Last edited by NBVC; 09-03-2011 at 02:34 PM.

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

    Re: Column to formulate an average of the current four dates

    Try:

    =AVERAGE(IF($A$1:$J$1>=LARGE($A$1:$J$1,4),$A$2:$J$2))

    where A1:J1 is the top row range, and A2:J2 is the inputs range.

    if you want to exclude blanks in A2:J2

    =AVERAGE(IF($A$1:$J$1>=LARGE($A$1:$J$1,4),IF($A$2:$J$2<>"",$A$2:$J$2)))

    either of these formulas are to be confirmed with CTRL+SHIFT+ENTER not just ENTER to work properly
    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
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Column to formulate an average of the current four dates

    From PM:

    Thank for the information. I am now getting an error message (#VALUE!) in the cell where I want the formula to give me my answer. In row #1 I have all my Sunday dates (i.e-8/7, 8/14, 8/21, etc). In row #2 I have a numbered value under each date as it pertains to what happened within that date. At the end of the row, I have a cell in which I only want to capture the four most current dates with data. I have my dates all the way through the end of the year 2011. Every time I enter data under a new date, I would like the formula to only pick up the current four date with data.
    After you enter the formula, hold the CTRL and SHIFT keys down, then press ENTER. Do you now get a numeric result?

  4. #4
    Registered User
    Join Date
    09-01-2011
    Location
    Wayne, PA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Column to formulate an average of the current four dates

    Thank for the information. I am now getting an error message (#VALUE!) in the cell where I want the formula to give me my answer. In row #1 I have all my Sunday dates (i.e-8/7, 8/14, 8/21, etc). In row #2 I have a numbered value under each date as it pertains to what happened within that date. At the end of the row, I have a cell in which I only want to capture the four most current dates with data. I have my dates all the way through the end of the year 2011. Every time I enter data under a new date, I would like the formula to only pick up the current four date with data.

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

    Re: Column to formulate an average of the current four dates

    I replied to that above.

  6. #6
    Registered User
    Join Date
    09-01-2011
    Location
    Wayne, PA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Column to formulate an average of the current four dates

    When I enter the formula with the blanks which is the second option and I do the Control+SHIFT+ENTER I get the value of 8. The only issue I have is that when I average the four current Sundays to date using the formula AVERAGE=(T2:W2) it equals 5.75 which is then rounded 6. Not to sure what the 8 is representing. using the second formula above.

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

    Re: Column to formulate an average of the current four dates

    You are right... try:

    =AVERAGE(IF(A2:W2<>"",IF(COLUMN(A2:W2)>=LARGE(IF(A2:W2,COLUMN(A2:W2)),4),A2:W2)))

    confirmed with CTRL+SHIFT+ENTER

  8. #8
    Registered User
    Join Date
    09-01-2011
    Location
    Wayne, PA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Column to formulate an average of the current four dates

    It worked. Thank you.

+ 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