+ Reply to Thread
Results 1 to 8 of 8

Need Formula to subtract Different date and time

  1. #1
    Registered User
    Join Date
    01-14-2008
    Posts
    10

    Need Formula to subtract Different date and time

    Hello all....

    I am trying to find a formula to subtract 2 different dates and times, and come up with an hhhh:mm formated answer.

    For example,

    Cell No. A1 has 1/20/10 04:46
    Cell No. A2 has 2/5/10 18:10

    I can get the hours to come out right, but it doesn't include multiple days.

    Thanks for your help.

  2. #2
    Registered User
    Join Date
    01-14-2008
    Posts
    10

    Re: Need Formula to subtract Different date and time

    Let me try to clear this up a little bit more....

    Cell A1 has 1/20/10
    Cell A2 has 04:46
    Cell A3 has 2/5/10
    Cell A4 has 18:10

    I know the formula for subtracting time is A4+(A2>A4)-A2

    But is there any way to get the dates broken down to hours?

    Thanks

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Need Formula to subtract Different date and time

    =((A2+(A2<A1))-A1)

    and then put a custom format of [h]:mm:ss

    If you want to see the result as 16 days, 13.40 hours

    try...

    INT(A2-A1)&" days, "&TEXT(MOD(A2-A1,1)*24,"0.00")&" hours"
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    01-14-2008
    Posts
    10

    Re: Need Formula to subtract Different date and time

    Thanks for the quick reply!

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Need Formula to subtract Different date and time

    If you are satisfied with the answer provided, please don’t forget to mark the thread as solved.

    How to mark a thread Solved
    Go to the first post
    Select
    -- Edit
    -- Go Advanced
    -- Below the word Title you will see a dropdown with the word No prefix
    -- Update to Solved and then select Save

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need Formula to subtract Different date and time

    @Chobi, we have several Q & A forums - Tips & Tutorials is not one of them - please ensure you post in the most appropriate forum for your question.

    Thread moved to Worksheet Functions.

  7. #7
    Registered User
    Join Date
    04-19-2012
    Location
    Bristol, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Need Formula to subtract Different date and time

    I have a similar request

    Cell A1 has 20/06/2013
    Cell A2 has 14:05:00
    Cell A3 has 21/06/2013
    Cell A4 has 18:10:00

    I need to get the combined difference in hours between the combined A3&A4 to A1&A2 but bring it back in hours & mins

    Thanks
    Andy

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need Formula to subtract Different date and time

    potterands,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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