Time Calculation

uswyne

Board Regular
Joined
Jul 27, 2017
Messages
78
Office Version
  1. 2019
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
Hello,
Please help me for putting excel formula in given sheet column C.
Thanks
A​
B​
C​
Time IN (07:00 Am)
Calculate Time before 7:00 AM​
Time Out (07:00 PM)​
Calculate Time before 7:00 PM​
Over Time​
6:30 AM​
8:00 PM​
1.5 this result is needed
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try

Book1
ABCDE
1Time IN (07:00 Am)Time Out (07:00 PM)Over Time
2Calculate Time before 7:00 AMCalculate Time before 7:00 PM
36:30 AM8:00 PM1.51.5 this result is needed
4
5
Sheet5
Cell Formulas
RangeFormula
C3C3=(TIME(7,0,0)-A3+B3-TIME(19,0,0))*24
 
Upvote 0
Try

Book1
ABCDE
1Time IN (07:00 Am)Time Out (07:00 PM)Over Time
2Calculate Time before 7:00 AMCalculate Time before 7:00 PM
36:30 AM8:00 PM1.51.5 this result is needed
4
5
Sheet5
Cell Formulas
RangeFormula
C3C3=(TIME(7,0,0)-A3+B3-TIME(19,0,0))*24
Thanks, but there is problem if the time out is less than 1900 hrs reult shows Minus value.
 
Upvote 0
See if this works.

Book1
ABCD
1Time IN (07:00 Am)Time Out (07:00 PM)Over Time
2Calculate Time before 7:00 AMCalculate Time before 7:00 PM
36:30 AM8:00 PM1.5
4
5
6
Sheet5
Cell Formulas
RangeFormula
C3C3=IF(B3-A3<TIME(12,0,0),0,((B3-A3)-(TIME(19,0,0)-TIME(7,0,0)))*24)
 
Upvote 0
If it is the same issue at both the start and end times then maybe:
Excel Formula:
=(MAX(TIME(7,0,0)-A3,0)
 +MAX(B3-TIME(19,0,0),0))*24
 
Upvote 0
Hi Alex

I think OP wants to calculate overtime if above 12 hours 7 AM and PM

If that is the case, please see below

Book1
ABCD
1Time IN (07:00 Am)Time Out (07:00 PM)Over Time
2Calculate Time before 7:00 AMCalculate Time before 7:00 PM
36:30 AM5:00 PM0
40.5
5
Sheet5
Cell Formulas
RangeFormula
C3C3=IF(B3-A3<TIME(12,0,0),0,((B3-A3)-(TIME(19,0,0)-TIME(7,0,0)))*24)
C4C4=(MAX(TIME(7,0,0)-A3,0)+MAX(B3-TIME(19,0,0),0))*24
 
Upvote 0
Hi, I got what I wanted but now I need to answer 1:30 instead of 1.5.
can u help me out?
 
Upvote 0

Forum statistics

Threads
1,215,746
Messages
6,126,650
Members
449,326
Latest member
asp123

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