View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Archimedes' Lever Archimedes' Lever is offline
external usenet poster
 
Posts: 63
Default How do I calc the time difference in hh:mm for shift work?

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.

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.

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.