
Originally Posted by
naiku
OK, so I managed to figure the first part out. But now am stuck with a different problem. I am trying to calculate start/end times for jobs running on a machine based on a 20 hour day, 5 day work week. Shift starts at 6am, and ends at 2am (the following day).
I am using the following formula in cell C1:
=WORKDAY(B1,CEILING((B2+MOD(B1,1)-B$3)/(B$4-B$3),1)-1)+MOD(B1,1)+B2-CEILING(MOD(B1,1)+B2-B$3,B$4-B$3)+B$4-B$3
B1 - Start Time (5/4/12 11:00am)
B2 - Run Hours (4 hours)
B3 - Shift Start (6:00am)
B4 - Shift End (2:00am)
C1 would then show End Time as 5/4/12 3:00pm.
If my Shift End time is before midnight, then it works no problem. As soon as I change that time to 2am, I get a #NUM! error.
Any ideas? It's got me stumped.
Thanks.