View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default How do I calc the time difference in hh:mm for shift work?

Answers interspersed below.
--
David Biddulph

"Archimedes' Lever" wrote in message
...
On Tue, 28 Apr 2009 08:03:27 -0600, "Fred Smith"
wrote:

Format of a cell is immaterial to its calculation.


Perhaps, but the code given is 24 hr explicit code, if you'll simply
look at the numbers used to perform the calculations.


Whether the time is displayed in 12 hour or 24 hour format will make no
difference to the result of the calculation, as Fred said.

Formatting controls only
the display, not the way it's stored internally.


It also becomes a data validator as it only allows data to be entered
into such a cell in a matching format.


Data validation and cell display formatting are two distinct features in
Excel. You can't use cell display formatting to perform the data validation
function. A cell displayed in 24 hour format doesn't prevent anyone
entering time in 12 hour format, nor does it prevent time beyond 24 hours
being entered.

Any formula that works with
time, will work with all formats of it.


OK

In your response, you should indicate that you are converting time to
decimal hours. The result would need to be formatted as a number.


Yes, the answer is a decimal version, but anyone that tracks time
segments in other than quarter hours is nuts to begin with, so I would
also limit input into the time fields to quarter hour break points.

Regards,
Fred.
"Sum Ting Wong" <SumTingWong@thebarattheendoftheVenusianLightnigBo lt.org
wrote in message ...

=IF((OR(H10="",G10="")),0,IF((H10<G10),((H10-G10)*24)+24,(H10-G10)*24))

G10 is start time, H10 is stop time. Change to your start and stop
cell names.

Sorry, but 24 hour format is required here. There may be a 12 hr
format version I do not know about.