I have a Night Differential column in a table to report overtime hours worked. In the Night Differential column, I only count hours worked between 00:00-24:00 that are prior to 06:00 (6AM) and after 18:00 (6PM). The calculation below works OK.
=IF(AND(INDEX(OT_Table.End_Time,ROW())<>"",TIMEVALUE(INDEX(OT_Table.Start_Time,ROW()))<0.25,TIMEVALUE(INDEX(OT_Table.End_Time,ROW()))<=0.75),(0.25-VALUE(INDEX(OT_Table.Start_Time, ROW())))*24,
IF(AND(INDEX(OT_Table.End_Time,ROW())<>"",TIMEVALUE(INDEX(OT_Table.Start_Time,ROW()))>=0.25,TIMEVALUE(INDEX(OT_Table.End_Time,ROW()))>0.75),(VALUE(INDEX(OT_Table.End_Time, ROW()))-0.75)*24,
IF(AND(INDEX(OT_Table.End_Time,ROW())<>"",TIMEVALUE(INDEX(OT_Table.Start_Time,ROW()))<0.25,TIMEVALUE(INDEX(OT_Table.End_Time,ROW()))>0.75),((0.25-VALUE(INDEX(OT_Table.Start_Time, ROW())))*24)+((VALUE(INDEX(OT_Table.End_Time, ROW()))-0.75)*24),
0)))
What I'm trying to do is round up to the nearest half hour, so... by multiples of .5. I tried the following with no luck. It doesn't return any number, just blank.
=IF(AND(INDEX(OT_Table.End_Time,ROW())<>"",TIMEVALUE(INDEX(OT_Table.Start_Time,ROW()))<0.25,TIMEVALUE(INDEX(OT_Table.End_Time,ROW()))<=0.75),(0.25-MROUND(VALUE(INDEX(OT_Table.Start_Time, ROW())),.5)*24, ... (and so on)