Two steps: 1) Enter time with a colon separating the hours and minutes
(18:00 or 4:00), and 2) Format the cells in military time {Press Ctrl 1 or go
to the Format Menu -> Cells -> Number tab -> Time [select the military format
you want (ex: 13:00) -> press OK]}. Hope this helps.
I should learn how to use Boolean instead of IF( ). Case in point +(B21<A21)*.....
If B21 = A21, there is no way to tell if it is the next day or the same day. I guess depending on the user's need, one may have to change the formula to
=B21-A21+(B21<=A21)*2400 to reflect 2400 for the lapse of one day.
Any comments?
Epinn
=B21-A21+(B21<A21)*2400
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
I should learn how to use Boolean instead of IF( ). Case in point +(B21<A21)*.....
If B21 = A21, there is no way to tell if it is the next day or the same day.
I guess depending on the user's need, one may have to change the formula to
=B21-A21+(B21<=A21)*2400 to reflect 2400 for the lapse of one day.
The formula already has an algorithm to determine whether it goes over
midnight, that is whan the +(B21<=A21)*2400 is doing, it determines that it
goes over midnight if the end time is earlier than the start time, on the
basis that the task will not be greater than 24 hours. I suppose you could
argue he might start at 8:00 and finish at 8:00.
The above fomulae (Bob's and mine) only work for hourly times as in the
example given. But for other times an adjustment is needed eg 2115 to
800 should give 1045 (not 1085). This should work for all times entered
in "hhmm" format:
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.