.... but what if you want to know the difference between 24:00 and 7:00 AM. the 24:00 formats itself as 00:00. How can I stop it doing this? And it always won't be in the same cell. The answer is OK, it's just the zeroing off of the 24. Worksheet is a timesheet of employee times.
----- Norman Harker wrote: -----
Hi Jason!
No need to post to more than one group and you should try and keep to
the same thread for the same question.
Here's the reply given before:
Frank and the link provided by Niek give you the answer.
Here it is explained step by step:
In A1 put:
23:50
In B1 put:
7:00
In C1 put:
=B1-A1+(B1<A1)
Returns 7:10
Time is recorded by Excel as a decimal part of 1 day. If you have
spanned Midnight, the second time in most uses will be an earlier
number than the first one. We make use of that by adding 1 if it is an
earlier number.
If you want that as decimal hours you can use:
=(B1-A1+(B1<A1))*24
Returns 7.166667
An alternative approach is to put the date and time in your entries
and in that case the simple solution would then be =B1-A1
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.