Hello,
<table border="1" cellspacing="0" cellpadding="0" style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:80px;" /><col style="width:111px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td >*</td><td >A</td><td >B</td><td >C</td><td >D</td><td >E</td><td >F</td><td >G</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="font-weight:bold; text-align:center; ">Day</td><td style="font-weight:bold; text-align:center; ">From</td><td style="font-weight:bold; text-align:center; ">til</td><td style=" border-right-style:solid; border-right-width:1px; border-right-color:#000000; ">*</td><td style="background-color:#ffff00; font-weight:bold; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-top-color:#000000; border-right-color:#000000; border-bottom-color:#000000; ">Day</td><td style="background-color:#ffff00; font-weight:bold; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-top-color:#000000; border-right-color:#000000; border-bottom-color:#000000; ">time</td><td style="background-color:#ffff00; font-weight:bold; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-top-color:#000000; border-right-color:#000000; border-bottom-color:#000000; ">24hr time period</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="font-weight:bold; text-align:center; ">1</td><td style="text-align:right; ">11:30</td><td style="text-align:right; ">21:00</td><td style=" border-right-style:solid; border-right-width:1px; border-right-color:#000000; ">*</td><td style="background-color:#ffff00; text-align:right; border-right-style:solid; border-bottom-style:solid; border-right-width:1px; border-bottom-width:1px; border-right-color:#000000; border-bottom-color:#000000; ">2</td><td style="background-color:#ffff00; text-align:right; border-right-style:solid; border-bottom-style:solid; border-right-width:1px; border-bottom-width:1px; border-right-color:#000000; border-bottom-color:#000000; ">12:00</td><td style="background-color:#ffff00; text-align:right; border-right-style:solid; border-bottom-style:solid; border-right-width:1px; border-bottom-width:1px; border-right-color:#000000; border-bottom-color:#000000; ">14:00</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="font-weight:bold; text-align:center; ">2</td><td style="text-align:right; ">07:00</td><td style="text-align:right; ">16:30</td><td >*</td><td >*</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="font-weight:bold; text-align:center; ">3</td><td style="text-align:right; ">08:30</td><td style="text-align:right; ">13:00</td><td >*</td><td >*</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="font-weight:bold; text-align:center; ">4</td><td style="text-align:right; ">10:00</td><td style="text-align:right; ">20:30</td><td >*</td><td >*</td><td >*</td><td >*</td></tr><tr style="height:17px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="font-weight:bold; text-align:center; ">5</td><td style="text-align:right; ">07:15</td><td style="text-align:right; ">15:30</td><td >*</td><td >*</td><td >*</td><td >*</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >G2</td><td >=IF(F2>VLOOKUP<span style=' color:008000; '>(E2,A2:C6,3,0)</span>,VLOOKUP<span style=' color:008000; '>(E2,A2:C6,3,0)</span>-VLOOKUP<span style=' color:008000; '>(E2,A2:C6,2,0)</span>,F2-VLOOKUP<span style=' color:008000; '>(E2,A2:C6,2,0)</span>)+IF(F2>VLOOKUP<span style=' color:008000; '>(E2-1,A2:C6,3,0)</span>,0,IF<span style=' color:008000; '>(VLOOKUP<span style=' color:#0000ff; '>(E2-1,A2:C6,2,0)</span>>F2,VLOOKUP<span style=' color:#0000ff; '>(E2-1,A2:C6,3,0)</span>-VLOOKUP<span style=' color:#0000ff; '>(E2-1,A2:C6,2,0)</span>,VLOOKUP<span style=' color:#0000ff; '>(E2-1,A2:C6,3,0)</span>-F2)</span>)</td></tr></table></td></tr></table>
You can change the values in E2 and F2. From this time my formula in G2 looks 24 hours back.