Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtracting one time from another in Excel 2

Status
Not open for further replies.

codehead

Programmer
Aug 25, 1999
96
0
0
US
Hello,

Does anyone know how to subtract one time field (13:10:23 for example) from another? Is there a built in function in Excel or do I have to split the hour, minute and second into separate fields and then do the math?

Thanks!

Codehead
 
Simply subtracting the two time values should result in a fractional number that represents the portion of 24hours that is the difference between the two.

For example:
A1 = 8:00 am
A2 = 5:30 pm
A3 = A1 - A2
A3 will be 0.395833333 (when you format it to General)

To determine the number of hours elapsed:
A4 = A3 * (24)

To determine the number of minutes elapsed:
A5 = A3 * (24 * 60)

etc...

Hope that helps.
 
Hi,
Just a further clarification of what Date & Time values are.

The integer portion of a date value is relative to 1/1/1900. Today is 37442.

The fractional portion of a date value is Time. Taking a difference in two date/time values, one can calculate hours, minutes and seconds.

If the DIFFRERENCE is formatted [h]:mm:ss, it will display the true difference in hours which may be greater than 24 in many instances.

Hope this helps :) Skip,
SkipAndMary1017@mindspring.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top