Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-27-2022, 10:30 AM
ArviLaanemets ArviLaanemets is offline Another Military Time conundrum Windows 8 Another Military Time conundrum Office 2016
Expert
 
Join Date: May 2017
Posts: 960
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

I'm not sure about this military time stuff - is it possible to format Excel cell containing date or time as military time (format "hhmm"), or it is really an integer value, but anyway having only time registered (without date part) will make any calculations with those times (on and off) a headache!

Let's assume you have columns OnTime and OffTime formatted as time (I'll leave military part off now - so "hh:mm" - i.e. without date part).

When both OnTime and OffTime are always on same date, calculating working time is easy:
WorkTime = OffTime - OnTime. Like 16:00 - 08:00 = 08:00.

When OnTime is on one date, and OffTime is on next date, and working time is less than 24 hours (like OnTime = 16:00 and OffTime = 02:00), the formula for WorkTime must check which time has greater value. When OffTime is greater, then WorkTime = OnTime - OffTime. When OnTime is greater, then WorkTime = 24:00 - OnTime + OffTime.

Thins get more messy, when working time can be more than 24 hours. Like OnTime = 16:00 on first day, and OffTime = 18:00 on next day. Having only time registered, you have no way to check, were you off on same day or on next one.

The only way to make the calculation foolproof, is to include date part too (NB! You can format both columns to display only time, but you have to enter date and time!). Like
OnTime = 26.07.2022 16:00, OffTime = 27.07.2022 18:00. Column WorkTime must be formatted as "[h]:mm" (NB! Brackets are essential here!). The formula for WorkTime will be simply WorkTime = OffTime - OnTime, and will return 26:00 (This format displays times over 24 hours. Any other time format displays 02:00!).

When you can format datetime columns as military time, the last formula will work too. When you can't - then maybe someone can give better advice!
Reply With Quote
 

Tags
boogered up, military time



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I plot data points on time axis proportionally to time scale? gib65 Excel 4 04-05-2022 10:24 PM
Obtaining a decimal total hours from military time entries (my solution works only in Google Sheets) gluonman Excel 8 03-22-2017 08:26 PM
Another Military Time conundrum Employee Turnover by Department/Month split between Voluntary/Involuntary - Full-time/Part-time CPSmith Excel 1 03-26-2016 02:48 AM
Military Font in Word jmdraft Word 2 03-06-2016 05:31 AM
IE Object: Run-time problem (the link is not clicked in run-time but not in step-in tinfanide Excel Programming 1 03-04-2012 12:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft