+ Reply to Thread
Results 1 to 5 of 5

subtracting dates and hh:mm:ss

  1. #1
    Registered User
    Join Date
    03-25-2013
    Location
    Augusta
    MS-Off Ver
    Excel 2010
    Posts
    2

    subtracting dates and hh:mm:ss

    I'm trying to subtract two cells which contain both a date and a time.

    05/03/2012 10:31:00 05/03/2012 11:02:40
    05/06/2012 11:57:55 05/06/2012 12:08:30

    Above is an example of what I want to subtract. I want to subtract B1-A2 and I would like the results in hours. I found a thread that had (=INT(B1-A2)&" days, "&TEXT(MOD(B1-A2,1)*24,"0.00")&" hours") but it doesn't work like I want it to. I also tried just a simple (=B1-A2) but it ignores the date in the cell. At the end I need to be able to take all my results and take an average in hours.

    An example would be that (=B1-A2) =72:55:15.

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: subtracting dates and hh:mm:ss

    Hi wisas62

    just subtract one from the other and format cells as "[h]:mm

    Those time subtracted are only 31 mins & 10 mins.
    Time.PNG
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Registered User
    Join Date
    03-25-2013
    Location
    Augusta
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: subtracting dates and hh:mm:ss

    No, I need to subtract multiple days;

    05/06/2012 11:57:55 - 05/03/2012 11:02:40

    which is 72:55:15.

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: subtracting dates and hh:mm:ss

    =TEXT(A2, "mm/dd/yyyy hh:mm:ss") - TEXT(B1,"mm/dd/yyyy hh:mm:ss")

    this worked for me using your B1-A2 scenario....this assumes that your date/times are not real date/times but TEXT/STRINGS....if that doesn't make sense let me know and I'll try to let you know how DATE/TIMES are represented in Excel....HTH
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  5. #5
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: subtracting dates and hh:mm:ss

    oops.....you will need to format the cells like Kevin suggested....except maybe adding a :ss to the end for seconds....

+ 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