+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Average number of days between two events

  1. #1
    Registered User
    Join Date
    04-16-2012
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    18

    Average number of days between two events

    I'm looking for the average number of days between entry date and interview date during August 2011.

    I filtered the data between 8/1/11 and 8/31/11 in Sheet3.

    This formula returned #value error message:

    =SUMPRODUCT(--NETWORKDAYS(Sheet3!A4:Sheet3!A2000,Sheet3!I4:Sheet3!I2000))

    Suggestions?

    Catherine

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Average number of days between two events

    Catherine,

    Just take one from the other and divide by the count

    =SUMPRODUCT(--(Sheet3!A4:A2000-Sheet3!I4:I2000))/COUNT(A4:A2000)

    unless you want to ignore weekends?

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Average number of days between two events

    You can't feed NETWORKDAYS a range, even inside a SUMPRODUCT.

    However, this should work:

    =SUMPRODUCT(NETWORKDAYS(OFFSET(Sheet3!A4,ROW(1:1997)-1,0),OFFSET(Sheet3!I4,ROW(1:1997)-1,0))

    This will return the total number of days difference, so you'll still have to divide it by the number of dates to get an average.

  4. #4
    Registered User
    Join Date
    04-16-2012
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Average number of days between two events

    The offset formula worked. Thank you.

    Catherine

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Average number of days between two events

    Quote Originally Posted by CatherineCarey View Post
    I filtered the data between 8/1/11 and 8/31/11 in Sheet3.
    ...but all of the formulas suggested here will take into account all data in the range, whether visible or not. If you want to only take account of the August 2011 data then you'd need to do that by adding that criterion in to the formula or by using a formula that will only take account of the filtered data. The former is probably easier, e.g. to average workdays between those dates, when the first date is in August 2011 try this array formula

    =AVERAGE(IF(TEXT(Sheet3!A4:A2000,"mmm-yy")="Aug-11",NETWORKDAYS(Sheet3!A4:A2000+0,Sheet3!I4:I2000+0)))

    confirmed with CTRL+SHIFT+ENTER
    Last edited by daddylonglegs; 04-16-2012 at 05:56 PM.
    Audere est facere

+ 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