Well, without trying to duplicate the layout of your sheet:
Start time in Column B2
Finish Time in Column C2
Lunch Time in Column D
Total for the day in Column E
I assume that you are using Excel times like 7:00 AM and 5:00 PM
To get over the problem of times past midnight use
=Start Time-Finish Time + (Finish Time < Start Time)
ie =C2-B2+(C2<B2)
which will calculate the correct time wiether or not it crosses midnight
An alternative is:
=MOD(C2-B2,1)
Now let's see about lunch in D2:
I assume that you want a meal break at any time of the day provided the
worker has worked 6 hours
=IF(MOD(C3-B3,1)>TIME(6,0,0),TIME(1,0,0),0)
For a 1/2 hour break use Time(0,30,0)
This will return either the lunch break time or 0
so the total worked that day in E2 use:
=MOD(C2-B2,1)-D2
When you total the hours custom format the total cell as "[h]:mm" ( without
the quotes)
Incidentally times in XL are a fraction of a day so 1 is one day not 1 hour
so your use of 12, (which I don't understand), means 12 days to XL
The "across midnight" formulas work because if the finish time is smaller
that the start time (C2<B2) this return FALSE which XL converts to 1 in
arithmetic so the formula is: =C2-B1+1 (day). The MOD() version works
because MOD() is returning a positive number
If you need further help then just post back again
--
HTH
Sandy
In Perth, the ancient capital of Scotland
(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk