# Calculate difference in time for period over 24hrs - result in hours:min

1. ## Calculate difference in time for period over 24hrs - result in hours:min

Hi,

I'm trying to obtain a formula that will calculate the difference in time between two dates showing the result in hours and minutes.

I pulled this from another thread which gives the result in days:hours:mins

=INT(B1-A1)&" days "&TEXT(B1-A1,"h"" hrs ""m"" mins ""s""secs""")

what changes need to be made to show the result in hours:mins?

2. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

Format cell as [h]:mm

3. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

Thx for the reply zbor however simply changing the format of the cell does not give the required result.

If the total difference is 1 day 14hrs and 40 mins chaning the format to [h]:mm has no effect when using to calculate the difference.

=INT(B1-A1)&" days "&TEXT(B1-A1,"h"" hrs ""m"" mins ""s""secs""")

can anyone else help?

4. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

Here, try this:

Formula:
`Please Login or Register  to view this content.`

5. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

C2-A2
format cell as: [u]" hrs "mm" mins "ss" secs"

6. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

Originally Posted by zbor
Here, try this:

Formula:
`Please Login or Register  to view this content.`
That's the ticket - Thx zbor

7. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

I tried editing your original formula from:
``Please Login or Register  to view this content.``
to
``Please Login or Register  to view this content.``
and got it to output minus seconds. Maybe another option in addition to zbor's.

8. ## Re: Calculate difference in time for period over 24hrs - result in hours:min

Guess I should have re-read your post. You wanted to output as only hours and minutes.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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