+ Reply to Thread
Results 1 to 10 of 10

Date Interval Formula

  1. #1
    Registered User
    Join Date
    12-16-2011
    Location
    Columbus
    MS-Off Ver
    Excel 2007
    Posts
    76

    Date Interval Formula

    Esteemed Panel,

    I am trying to create a formula in column D to figure out the average days that lapse between each date for the data in Columns A, B, & C but have been unsuccessful
    Can you asisst?
    Attached Files Attached Files

  2. #2
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Date Interval Formula

    In cell D2 paste:

    Please Login or Register  to view this content.
    copy/autofill down.
    Docendo discimus.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Date Interval Formula

    Maybe one of

    =(C2-A2)/(COUNT(A2:C2)-1)

    =IF(COUNTBLANK(A2:C2),"",STDEVP(A2,C2))

  4. #4
    Registered User
    Join Date
    12-16-2011
    Location
    Columbus
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Date Interval Formula

    Cheshire - What would the formula look like if there are 5 date's - alal attached?
    Attached Files Attached Files

  5. #5
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Date Interval Formula

    You could go with an extension of the current formula:

    Please Login or Register  to view this content.
    or use an array formula:

    Please Login or Register  to view this content.
    confirmed as an array formula with Ctrl-Shift-Enter.

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Date Interval Formula

    You don't indicate if cheshire's assumption that rows with blank dates should not be averaged is correct or not.

    Either way you don't need to overcomplicate things with long formula, or arrays when there is simple generic solution with my first suggestion in post #3.

    With 3 dates =(C2-A2)/(COUNT(A2:C2)-1)

    With 5 dates =(E2-A2)/(COUNT(A2:E2)-1)

    With any other number of dates the basic construction of the formula is, =(last date - first date)/(COUNT(last date : first date)-1)

    To ignore rows with blanks =IF(COUNTBLANK(first date : last date),"",(last date - first date)/(COUNT(first date : last date)-1))

  7. #7
    Registered User
    Join Date
    12-16-2011
    Location
    Columbus
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Date Interval Formula

    Here is my issue - my data has lots of blanks across a potential 5 date's - please see attached.
    How should this be handled - I did a 'Countif' to figure out if I have 1 date or 4 - but the seqyences are not the same, so I am having a hard time applying your formula
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Date Interval Formula

    See how you get on with this one

    =IFERROR((MAX(A3:E3)-MIN(A3:E3))/(COUNT(A3:E3)-1),"N/A")

  9. #9
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Date Interval Formula

    In cell A3 paste:

    Please Login or Register  to view this content.
    Confirmed as an array formula with Ctrl-Shift-Enter, then copy autofill down.

    - - - - - - - -

    I don't have IFERROR (on Excel 2003 atm). Go with Jason's formula.
    Last edited by CheshireCat; 08-17-2012 at 03:51 PM.

  10. #10
    Registered User
    Join Date
    12-16-2011
    Location
    Columbus
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Date Interval Formula

    Genius - perfect.

+ 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