Time in/Out Diff

RudRud

Active Member
Joined
Feb 2, 2023
Messages
275
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
Book1
ABCDEF
1Time InTime OutHourMinuteCombine Hour with MinExpected Result
29:00 AM7:25 PM1.4285851:25
38:25 AM5:35 PM0.1710100:10
49:00 AM5:00 PM-1.00-60-60
57:35 AM7:00 PM2.4202:25
610:10 AM7:06 PM-0.07-4#VALUE!
Sheet1
Cell Formulas
RangeFormula
A2,A4A2=TIME(9,0,0)
B2B2=TIME(19,25,0)
C2:C6C2=MOD(B2-A2,1)*24-9
D2:D4,D6D2=(MOD(B2-A2,1)*24-9)*60
E2:E4E2=LET(Hr,MOD(B2-A2,1)*24-9, Min,(MOD(B2-A2,1)*24-9)*60, Min)
A3A3=TIME(8,25,0)
B3B3=TIME(17,35,0)
B4B4=TIME(17,0,0)
D5D5=TEXT((MOD(B5-A5,1)*24-9)*60/(24*60),"[hh]:mm")
E6E6=TEXT((MOD(B6-A6,1)*24-9)*60/(24*60),"[hh]:mm")


Hi, Expected Result is 1:25 and 0:10

How to convert minute/hour to Hour with Minutes
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
How about
Excel Formula:
=B2-A2-9/24
and format the cell as Time.
I'm not sure what you want for E4 as you can't have -ve time
 
Upvote 0
How about
Excel Formula:
=B2-A2-9/24
and format the cell as Time.
I'm not sure what you want for E4 as you can't have -ve time

Thanks Fluff for fast response, It's working great.

E4 supposed to be -1 pm, because its undertime below 9 hours , is that possible? or need to put to another column if undertime which below 9 hours
 
Upvote 0
You could use
Excel Formula:
=LET(ot,B2-A2-9/24,IF(ot>0,ot,"-"&TEXT(ABS(ot),"[h]:mm:ss")))
but the value for -ve time will be text rather than a number
 
Upvote 1
Solution
You could use
Excel Formula:
=LET(ot,B2-A2-9/24,IF(ot>0,ot,"-"&TEXT(ABS(ot),"[h]:mm:ss")))
but the value for -ve time will be text rather than a number

Ok, Thankyou :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,569
Messages
6,120,286
Members
448,953
Latest member
Dutchie_1

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