Results 1 to 4 of 4

Thread: Time and Date Calculation

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Location
    Lahore
    Posts
    214

    Arrow Time and Date Calculation

    well i have data like this in four cells

    date1 time1 date2 time2

    this data is in different cells . is it possible that i can have some formula which could actually count the difference between two times .. in hours/minutes/seconds .. considering the date aswell since time1 is on date1 and time2 is on date2 .. so all i need is the duration inbetween time1 and time2

    Regards

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Time and Date Calculation

    date and time in a1 and b1
    formula in c1 is
    Code:
    =a1-b1
    format the cell to date

    You can combine the cells too...
    a1 b1 Date and time
    a2 b2 Date and time
    c1 formula
    Code:
    =(b1-b2)+(a1-a2)

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Re: Time and Date Calculation

    There is a formula that can be used, which is not included in help topics.

    =DATEDIF(date1, date2,[time unit])

    for example, to get the number of months between two dates you write:

    =DATEDIF(date1, date2,"m")

  4. #4
    Member
    Join Date
    Nov 2008
    Posts
    35

    Re: Time and Date Calculation

    It seems to me that you can combine dates and times

    a1 b1 Date and time
    a2 b2 Date and time

    c1 formula
    Code:
    a1+b1
    c2 formula
    Code:
    a2+b2
    then to take the difference in c3 just subtract
    c3 code
    Code:
    c2-c1
    make sure that c3 is formatted to display in pertinent units, like time format listed as "37:30:55" which will display the difference in hours/min/seconds

    I have verified this and think I think that it works. Agreed?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width