Substacting two military times

J

Jake Swarty

I would like to be able to substract entry of two military times and come up with the difference in Hours and tenths of an hour. Example 0945-0800 = 145 converted to 1.75 hours.
 
N

Norman Harker

Hi Jake!

If you have your calculations in the form shown:

=(TIME(LEFT(A13,2),MID(A13,3,2),0)-TIME(MID(A13,6,2),RIGHT(A13,2),0))*
24

The Time functions use the syntax TIME(Hour, Minute, Second)
The text parsing functions LEFT, MID and RIGHT are extracting the
arguments for the TIME function
The result has to be multiplied by 24 since Excel treats time as a
decimal part of 1 day.

If you have your times in different cells you should be able to adapt
the above.

For Excel's handling of time generally see:

http://www.cpearson.com/excel/datetime.htm#TOC

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
Jake Swarty said:
I would like to be able to substract entry of two military times and
come up with the difference in Hours and tenths of an hour. Example
0945-0800 = 145 converted to 1.75 hours.
 
R

Ron Rosenfeld

I would like to be able to substract entry of two military times and come up with the difference in Hours and tenths of an hour. Example 0945-0800 = 145 converted to 1.75 hours.

With 0800 in A1 and 0945 in A2:

=DOLLARDE(A2/100,60) - DOLLARDE(A1/100,60)

If the DOLLARDE function is not available, and returns the #NAME? error,
install and load the Analysis ToolPak add-in.




--ron
 
Top