Compute Time

Vtookup

Board Regular
Joined
May 30, 2017
Messages
121
Office Version
  1. 2016
  2. 2013
Hi All.
I'm confused as how the sample video works and not mine. followed danny rocks and Michael
Girvin's works... but anyway, i'm computing time, end result will look like this (based on 8 hours work)
what will be the formula and format of Total and overtime?

in out in out [work hours] [overtime]
9:00Am 11am 5:00Pm 12:00Am 9 1
8:00Am 12pm 2:00Pm 6:00Pm 8 0

thanks in advance for the help
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,

One way to do that : Remove space from formula it's an html error

E2 <a2))+(d2-c2+(d2<c2))),"h:mm")
<a2))+(d2-c2+(d2<c2))),"h:mm")
=TEXT(((B2-A2+(B2 < A2))+(D2-C2+(D2 < C2))),"h:mm")

F2 =TEXT(E2-(8 / 1440)*60,"h:mm")

ABCDEF
1InOutInOutWork hoursOvertime
29:20 AM11:25 AM5:00 PM12:00 AM9:051:05
38:20 AM12:45 PM2:00 PM6:00 PM8:250:25

<tbody>
</tbody>

</a2))+(d2-c2+(d2<c2))),"h:mm")></a2))+(d2-c2+(d2<c2))),"h:mm")
 
Last edited:
Upvote 0
A possible way to do this:

Change the format for the time entry cells to [h]:mm (type in when in Format Cells>Custom). That will allow people to fill the cells using 24 hour format: 9:00 to 11:00 and 17:00 to 24:00.
Assuming the first series is in cells A2:D2
The total hours is calculated in E2 as
Code:
=((B2-A2)+(D2-C2))*24
The OT is calculated in F2 as:
Code:
=E2-8

You have to use 24 hour time when using this method, otherwise you have an issue if you go past midnight. Any time out past midnight has to be entered as 24:50 or 25:30, or something like that.
You can use standard time notation (non-24), but then you have to do some math when the out time is past midnight (you have to add 24 hours back in)

Hope this helps.

JL
 
Upvote 0
Wow. TEXT function, i underestimated it. the word itself have you think that it really have nothing to do with numbers.
i'm wrong and it just answered my frustration. Thanks admiral100.
also thanks to jumpingCrab, the 24 hour clock is not popular in my work place. also it's common on-line solution,
which is hard to process inside my head. :confused: for me, admiral100 solution is what i wanted. straightforward. no need for MOD, formating etc. just one convertion, if i need computation.
Thanks again guys for the help. God Bless.
 
Upvote 0
Hi, Good day everyone.
I'm having a problem figuring out how to to this : If A2<=1:30Am, Then B2=2:00AM, If A2<=2:30AM, Then B2=3:00 Am.

If you entered for example 12:00 - 1:30 on cell A2, i want the cell b2 to display 2:00
Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,800
Messages
6,121,641
Members
449,044
Latest member
hherna01

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