View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default Timesheet problem

Bit difficult without knowing what the data looks like, but making some
assumptions

If A1 holds the start time
B1 holds the finish time
The time worked between 02:00 and 04:00 can be calculated with

=IF(A1<TIME(4,0,0),MIN(B1,TIME(4,0,0)),0)-IF(A1<=TIME(4,0,0),MAX(A1,TIME(1,0
,0)),0)

This will not work if the start and end times are in different days.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Oi you" wrote in message
oups.com...
I use an Excel 2000 spreadsheet to log sub-contract work hours - and
as the hours are then used to calculate charges I use separate hours
and minutes columns (start hh, start mm; finish hh, finish mm). That
seemed the easiest way to me.

Everything is working just how I want it, but....I now need to
introduce a night charge:

A shift can start anytime day/night and finish anytime day/night. If,
the shift includes ANY time worked between 1 am and 4 am I then need to
(a) invoke an extra charge and (b) do some other checks in a different
spreadsheet.

How do I get Excel to test for this? Thanks for your help.