View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Nght shift allowance

Here is what I posted as a reply yesterday:

You can use the following formulas. Assume that the start time is in
A1 and the end time is in C1.

To calculate the number of hours between start and 6:00:00, use

=MAX(0,TIME(6,0,0)-A1)*24

To calculate the number of hours between 18:00:00 and end time, use

=MAX(0,C1-TIME(18,0,0)+(C1<TIME(18,0,0)))*24

To calculate the number of hours worked between 6:00:00 and 18:00:00,
excluding hours between 18:00 and 6:00:00, use

=(MIN(C1,TIME(18,0,0))-MAX(A1,TIME(6,0,0))+(C1<A1))*24

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)






On Tue, 25 Aug 2009 11:51:01 -0700, Maresa
wrote:

sorry if this is a duplicate, but I cannot see the question I posted last
night.
I need to calculate night shift allowance between the hours 18:00 and 6:00
the shift might run from 15:00 to 23:00, the allowance is then = 5 hours, or
it might start at 05:00 to 14:00, the answer should then be 1 hour.