+ Reply to Thread
Results 1 to 3 of 3

Calculating time OR age in days, hours, and minutes between two dates

  1. #1
    Registered User
    Join Date
    01-19-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    2

    Calculating time OR age in days, hours, and minutes between two dates

    I am trying to calculate the time between two dates, excluding weekends (I'm not too worried about holidays). I have five columns: Received, Completed, Time to Complete, Age, Finished

    I have found a formula that works between the Receveid date and Completed date when they are farther apart than 31 days:

    ex: =NETWORKDAYS(A8,B8)-1-(MOD(A8,1)>MOD(B8,1))&":"&TEXT(B8-A8,"hh:mm")

    But I also want to calculate the AGE of the job when it hasn't yet been completed, and with the formula above, the Time column displays an error, and I want it to remain empty. Please see the attached sample to see what I mean. Row 3 shows how I want it to look when the job has not been completed and it displays the age (but you will notice that the age is not correct as it would be 3 months old at this point). Row 4 shows what I want the Time and Age columns to look like when they have a value in them. And Row 5 shows what the Time columns look like with my current formula when the job has not yet been completed.

    So the two problems are:
    1 - calculate the Age when the two dates are farther than 31 days apart.
    2 - when the Time column is calculated, the Age column should be empty (and vice versa)

    Thanks for any help in advance!!!!
    Attached Files Attached Files
    Last edited by commanderboo; 01-23-2012 at 11:39 AM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,786

    Re: Calculating time OR age in days, hours, and minutes between two dates

    hello commanderboo, welcome to excelforum. Try this for C3 copied down

    =IF(B3="","",NETWORKDAYS(A3,B3)-1-(MOD(A3,1)>MOD(B3,1))&TEXT(B3-A3,":hh:mm"))

    and this for D3

    =IF(B3="",IF(A3="","",INT(NOW()-A3)&TEXT(NOW()-A3,":hh:mm")),"")
    Audere est facere

  3. #3
    Registered User
    Join Date
    01-19-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Calculating time OR age in days, hours, and minutes between two dates

    Quote Originally Posted by daddylonglegs View Post
    hello commanderboo, welcome to excelforum. Try this for C3 copied down

    =IF(B3="","",NETWORKDAYS(A3,B3)-1-(MOD(A3,1)>MOD(B3,1))&TEXT(B3-A3,":hh:mm"))

    and this for D3

    =IF(B3="",IF(A3="","",INT(NOW()-A3)&TEXT(NOW()-A3,":hh:mm")),"")
    daddylonglegs, you are a genius! I think knowing Excel the way you do is an art! This works perfectly, thanks so much!

+ 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