# Date and Time duration formula

1. ## Date and Time duration formula

I've been using with success the following formula to calculate the difference between two cells

=TEXT(D2-C2,"h:mm:ss")

This works if the two cells are formatted like

02/09/2013 07:00 - 02/09/2013 19:00

However this formula does not work if the cells are

mon 02/09/2013 07:00 - mon 02/09/2013 19:00

I extract a mass amount of data like this, is there a formula for this?

2. ## Re: Date and Time duration formula

=TEXT(RIGHT(D2,LEN(D2)-FIND(" ",D2))-RIGHT(C2,LEN(C2)-FIND(" ",C2)),"h:mm:ss")

or

=TEXT(RIGHT(D2,LEN(D2)-4)-RIGHT(C2,LEN(C2)-4),"h:mm:ss")

or

=TEXT(RIGHT(D2,16)-RIGHT(C2,16),"h:mm:ss")

Which one is best will really depend on any possible differences in the data.

3. ## Re: Date and Time duration formula

Each of those formulas works fine, thx very much

4. ## Re: Date and Time duration formula

Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

In future, to mark your thread as Solved, you can do the following -

Incase your issue is not solved, you can undo it as follows -

Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

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