time calculations

jtodd

Board Regular
Joined
Aug 4, 2014
Messages
194
Hi
I have a sheet that works out hours worked which all works fine till I hit exactly midnight .( see extract)
I am using this formula =(IF(F18>E18,F18-E18,24-E18+F18))-"00:30" (half an hour lunch)
I am using [h]:mm to format the totals but as you can see it does not work for the bottom 2

<colgroup><col style="mso-width-source:userset;mso-width-alt:4022;width:83pt" width="110"> <col style="mso-width-source:userset;mso-width-alt:4022;width:83pt" width="110"> <col style="mso-width-source:userset;mso-width-alt:2998;width:62pt" width="82"> <col style="mso-width-source:userset;mso-width-alt:4022;width:83pt" width="110"> <col style="mso-width-source:userset;mso-width-alt:4022;width:83pt" width="110"> <col style="mso-width-source:userset;mso-width-alt:2779;width:57pt" width="76"> </colgroup><tbody>
</tbody>
Start
Finnish
HoursStart Finnish HoursStart Finnish HoursTotal
06:0014:00
07:3006:0016:0009:3006:0014:0007:3024:30
06:0014:0007:3006:0016:0009:3006:0014:0007:3024:30
12:0000:0011:3012:0000:0011:3012:0001:0012:301691:30
12:0000:0011:3012:0000:0011:3012:0001:0012:301691:30

<colgroup><col style="width:48pt" span="3" width="64"> <col style="mso-width-source:userset;mso-width-alt:2084; width:43pt" span="2" width="57"> <col style="width:48pt" span="5" width="64"> </colgroup><tbody>
</tbody>

Presume it is something to do with the formatting of the Total , unless there is a better approach ?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Time is a fickle thing in Excel as it's a number masked to look like time. Could very well be you've copied time from a previous entry and it's 70 days in the past...

Use the MOD function to get round this


Book1
ABCDEFGHIJ
1StartFinnishHoursStartFinnishHoursStartFinnishHoursTotal
206:0014:0007:3006:0016:0009:3006:0014:0007:3024:30:00
306:0014:0007:3006:0016:0009:3006:0014:0007:3024:30:00
412:0000:0011:3012:0000:0011:3012:0001:0012:3035:30:00
512:0000:0011:3012:0000:0011:3012:0001:0012:3035:30:00
Sheet1
Cell Formulas
RangeFormula
I2=MOD(H2-G2, 1)-TIMEVALUE("00:30:00")
J2=I2+F2+C2
C2=MOD(B2-A2, 1)-TIMEVALUE("00:30:00")
F2=MOD(E2-D2, 1)-TIMEVALUE("00:30:00")
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

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