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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

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,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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