PDA

Click to See Complete Forum and Search --> : Time and Date Calculation


Dastard
Jun 6th, 2006, 02:15 AM
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

Ecniv
Jun 6th, 2006, 06:03 AM
date and time in a1 and b1
formula in c1 is

=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

=(b1-b2)+(a1-a2)

Fonty
Jun 6th, 2006, 09:29 AM
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")

John1in2
Mar 9th, 2009, 06:20 PM
It seems to me that you can combine dates and times

a1 b1 Date and time
a2 b2 Date and time

c1 formula
a1+b1

c2 formula
a2+b2

then to take the difference in c3 just subtract
c3 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?