Calculating overnight hours

adelao747

New Member
Joined
May 9, 2017
Messages
12
Hi guys,

I created a time entry spreadsheet for my company for employees who are working temporarily. However, the formula I have doesn't seem to calculate overnight hours well. The total hours keep coming-up as a negative. Does anyone know how to modify it so that I can calculate overnight hours? I have included my formula down below.

- If anyone knows how to attach a spreadsheet, please let me know, as this will be a lot easier.

Layout:
Time In (C9), Lunch Out (D9), Lunch In (E9), Time Out (F9), Total Hours (G9)

Formula:
=IF(((D9-C9)+(F9-E9))*24>8,8,((D9-C9)+(F9-E9))*24)


Thank so much!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Excel 2010
CDEFG
8StartLunchEndTotal
918:0020:0020:304:009.5
10
7b
Cell Formulas
RangeFormula
G9=(F9-C9+(F9)-(E9-D9))*24
 
Upvote 0
Excel Workbook
CDEFG
8InLunch outLunch InOutTot Hrs
97:00 AM11:00 AM12:00 PM4:00 PM8.00
107:00 PM10:00 PM11:00 PM4:00 AM8.00
117:45 PM11:00 PM12:00 AM4:30 AM7.75
Sheet14
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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