CALCULATE DATE AND TIME

P

Pam C

hOW DO i calculate the total time between two columns that contain a date and
a time.
 
B

Bob Phillips

Just subtract one from the other.

If you want it in hours, format it as [h]:mm. If you want days and it will
not exceed 31 days, format it as d hh:mm:ss. If it can be more than 31 days
you will need something like

=(INT(A1-B1)-(MOD(A1,1)>MOD(B1,1))&" days
")&TEXT(MOD(MOD(B1,1)-MOD(A1,1),1),"hh:mm")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
P

Pam C

my date is a2 3/28/06 19:11 and in b2 3/28/06 22:40
I tried the formula you gave me and it isn't working, I just want a number
in hours and minutes.

Thanks,

Bob Phillips said:
Just subtract one from the other.

If you want it in hours, format it as [h]:mm. If you want days and it will
not exceed 31 days, format it as d hh:mm:ss. If it can be more than 31 days
you will need something like

=(INT(A1-B1)-(MOD(A1,1)>MOD(B1,1))&" days
")&TEXT(MOD(MOD(B1,1)-MOD(A1,1),1),"hh:mm")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Pam C said:
hOW DO i calculate the total time between two columns that contain a date and
a time.
 
B

Bob Phillips

So just subtract the later from the other and format as [h]:mm

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Pam C said:
my date is a2 3/28/06 19:11 and in b2 3/28/06 22:40
I tried the formula you gave me and it isn't working, I just want a number
in hours and minutes.

Thanks,

Bob Phillips said:
Just subtract one from the other.

If you want it in hours, format it as [h]:mm. If you want days and it will
not exceed 31 days, format it as d hh:mm:ss. If it can be more than 31 days
you will need something like

=(INT(A1-B1)-(MOD(A1,1)>MOD(B1,1))&" days
")&TEXT(MOD(MOD(B1,1)-MOD(A1,1),1),"hh:mm")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Pam C said:
hOW DO i calculate the total time between two columns that contain a
date
and
 
Top