+ Reply to Thread
Results 1 to 4 of 4

Time Difference

  1. #1
    Registered User
    Join Date
    02-21-2008
    Posts
    12

    Time Difference

    Again tring to eliminate multiple formulas...

    Rep E-Date P-Date
    Eddie 4/1/08 4/25/08
    Eddie 4/2/08 4/13/08


    I am looking to get the diffence in days between the two dates and get an average of that difference.

    Right now i have a seperate function =datedif(x,x,"d"), then a seperate funtion {=average(if(x="Eddie",if(x=3,x)))}

    Any help appreciated

  2. #2
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    This combines them into one formula: =SUMPRODUCT(--(A1:A2="Eddie"),C1:C2-B1:B2)/COUNTIF(A1:A2,"Eddie")

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You don't really need DATEDIF if you want a difference in days, just subtract one date from the other, e.g.

    =C2-B2

    so for an average date difference when column A is Eddie,

    =AVERAGE(IF(A2:A10="Eddie",C2:C10-B2:B10))

    confirmed with CTRL+SHIFT+ENTER

  4. #4
    Registered User
    Join Date
    02-21-2008
    Posts
    12
    worked perfectly

+ 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