+ Reply to Thread
Results 1 to 4 of 4

Date and Time duration formula

  1. #1
    Registered User
    Join Date
    09-16-2013
    Location
    Cambridge
    MS-Off Ver
    Excel 2011
    Posts
    8

    Question 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?

    thx in advance

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    6,852

    Re: Date and Time duration formula

    How about something like:
    =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.
    Last edited by BadlySpelledBuoy; 09-16-2013 at 12:35 PM.

  3. #3
    Registered User
    Join Date
    09-16-2013
    Location
    Cambridge
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: Date and Time duration formula

    Each of those formulas works fine, thx very much

  4. #4
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    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 -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    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.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Calculating duration with strange date / time format
    By chrispx001 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-12-2013, 11:08 AM
  2. Weeks left in a month after a certain date for a certain duration of time
    By mknapp21 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2012, 03:34 PM
  3. Help with time duration formula..
    By amper in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 12-28-2006, 11:46 AM
  4. Date/time Duration
    By zjay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2005, 06:06 AM
  5. Time duration formula
    By Ska in forum Excel General
    Replies: 2
    Last Post: 02-18-2005, 10:06 AM

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