time worked calculation

imanoone2u

New Member
Joined
Aug 14, 2004
Messages
11
time worked calculation over 2 days
the company I work for has a rule where we can only work 12 hrs in any 24hr time period
how can i work this out in an excel spreadsheet if eg: Day 1 start shift 11:30am finish 21:00pm, day 2 start 7:00am finish 16:30pm I'd like to work out how many hr i work from any point in day 1 to 24hr later in day 2. thanks
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top