+ Reply to Thread
Results 1 to 5 of 5

AVERAGE with flexible date ranges

  1. #1
    Registered User
    Join Date
    09-30-2010
    Location
    PA
    MS-Off Ver
    Excel 2003
    Posts
    1

    AVERAGE with flexible date ranges

    Column A contains DATES
    Column B contains a number
    Example:
    01/02/1997 308

    Start Date (cell C1)
    End Date (cell C2)
    Average (cell C3)

    Based on this information, how do I write a formula that will give me the AVERAGE in C3 based on the date ranges I enter into C1 and C2?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: AVERAGE with flexible date ranges

    Assuming XL2003 (ie pre XL2007 and thus pre-AVERAGEIFS) - you can use:

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Both of the above assume that where a date value exists in A a numeric value will exist in B.

  3. #3
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: AVERAGE with flexible date ranges

    To Do it without using an array:

    Please Login or Register  to view this content.
    Last edited by mgaworecki; 10-01-2010 at 02:15 PM.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: AVERAGE with flexible date ranges

    mgaworecki - a SUMPRODUCT is really no more efficient than an Array - they are processed in the same way and are subject to similar (though not identical) constraints.

    Moreover in this instance I would say the benefit of "standard" entry is offset by the fact you're using two SUMPRODUCTs as opposed to a single array as per the AVERAGE.

    If you're using SUMPRODUCT in preference to AVERAGEIFS then the implication is that you're assuming a version pre XL2007 in which case entire column references are not permitted.

    If AVERAGEIFS is not viable my first preference would the first option outlined in post # 2 as it is the most efficient - esp. if there is a need to work with large data sets.

  5. #5
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: AVERAGE with flexible date ranges

    Thanks DO,

    I was not aware of that. I appreciate the lesson.

    My problem with excel is that although I can usually find a way to do what I want, it may not be the best way. I am always looking for input.

+ 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