Multiply and convert minutes to hours

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
Hi all, kindly require to provide me support so that to create a VBA code which should convert the minutes decimals in col. "L" to hours multiplying by 0.60. On my first below extract i appear the original data and on second i appear the expected result.

e.g. 01-Aug-2018 9.67 should be 9.40 (67*0.60=40.20). we get the first decimals (40) and should turn the number 9.67 to 9.40.

Thanks in advance

Original data


<tbody>
[TD="class: xl64, align: center"][/TD]
[TD="class: xl74, width: 72, align: center"]A[/TD]
[TD="class: xl74, width: 170, align: center"]B[/TD]
[TD="class: xl74, width: 88, align: center"]C[/TD]
[TD="class: xl74, width: 66, align: center"]D[/TD]
[TD="class: xl74, width: 71, align: center"]E[/TD]
[TD="class: xl74, width: 60, align: center"]F[/TD]
[TD="class: xl74, width: 68, align: center"]G[/TD]
[TD="class: xl77, width: 64, align: center"]L[/TD]

[TD="align: center"]1[/TD]
[TD="class: xl65, align: center"]CODE[/TD]
[TD="class: xl65, align: center"]Name[/TD]
[TD="class: xl65, align: center"]Date[/TD]
[TD="class: xl71, width: 66, align: center"]TIME ON DUTY[/TD]
[TD="class: xl70, width: 71, align: center"]TIME OFF DUTY[/TD]
[TD="class: xl65, align: center"]IN[/TD]
[TD="class: xl65, align: center"]OUT[/TD]
[TD="class: xl65, align: center"]W. HRS[/TD]

[TD="align: center"]2[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl72, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl69, align: center"]01-Aug-18[/TD]
[TD="class: xl68, align: center"]08:00[/TD]
[TD="class: xl68, align: center"]17:00[/TD]
[TD="class: xl76, align: center"]7:30[/TD]
[TD="class: xl76, align: center"]17:10[/TD]
[TD="class: xl66, align: center"]9.67[/TD]

[TD="align: center"]3[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl72, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl69, align: center"]02-Aug-18[/TD]
[TD="class: xl68, align: center"]08:00[/TD]
[TD="class: xl68, align: center"]17:00[/TD]
[TD="class: xl76, align: center"]7:45[/TD]
[TD="class: xl75, align: center"]16:30[/TD]
[TD="class: xl66, align: center"]8.75[/TD]

[TD="align: center"]4[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl72, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl69, align: center"]03-Aug-18[/TD]
[TD="class: xl68, align: center"]08:00[/TD]
[TD="class: xl68, align: center"]17:00[/TD]
[TD="class: xl76, align: center"]8:14[/TD]
[TD="class: xl76, align: center"]17:20[/TD]
[TD="class: xl66, align: center"]9.10[/TD]

[TD="align: center"]5[/TD]
[TD="class: xl67, align: center"]1[/TD]
[TD="class: xl72, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl69, align: center"]04-Aug-18[/TD]
[TD="class: xl68, align: center"]08:00[/TD]
[TD="class: xl68, align: center"]17:00[/TD]
[TD="class: xl76, align: center"]7:45[/TD]
[TD="class: xl75, align: center"]16:14[/TD]
[TD="class: xl66, align: center"]8.48[/TD]

</tbody>


Expected result


<tbody>
[TD="class: xl66, align: center"][/TD]
[TD="class: xl76, width: 72, align: center"]A[/TD]
[TD="class: xl76, width: 170, align: center"]B[/TD]
[TD="class: xl76, width: 88, align: center"]C[/TD]
[TD="class: xl76, width: 66, align: center"]D[/TD]
[TD="class: xl76, width: 71, align: center"]E[/TD]
[TD="class: xl76, width: 60, align: center"]F[/TD]
[TD="class: xl76, width: 68, align: center"]G[/TD]
[TD="class: xl79, width: 64, align: center"]L[/TD]

[TD="align: center"]1[/TD]
[TD="class: xl67, align: center"]CODE[/TD]
[TD="class: xl67, align: center"]Name[/TD]
[TD="class: xl67, align: center"]Date[/TD]
[TD="class: xl73, width: 66, align: center"]TIME ON DUTY[/TD]
[TD="class: xl72, width: 71, align: center"]TIME OFF DUTY[/TD]
[TD="class: xl67, align: center"]IN[/TD]
[TD="class: xl67, align: center"]OUT[/TD]
[TD="class: xl67, align: center"]W. HRS[/TD]

[TD="align: center"]2[/TD]
[TD="class: xl69, align: center"]1[/TD]
[TD="class: xl74, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl71, align: center"]01-Aug-18[/TD]
[TD="class: xl70, align: center"]08:00[/TD]
[TD="class: xl70, align: center"]17:00[/TD]
[TD="class: xl78, align: center"]7:30[/TD]
[TD="class: xl78, align: center"]17:10[/TD]
[TD="class: xl68, align: center"]9.40[/TD]

[TD="align: center"]3[/TD]
[TD="class: xl69, align: center"]1[/TD]
[TD="class: xl74, align: center"]EMPLOYEE 1 [/TD]
[TD="class: xl71, align: center"]02-Aug-18[/TD]
[TD="class: xl70, align: center"]08:00[/TD]
[TD="class: xl70, align: center"]17:00[/TD]
[TD="class: xl78, align: center"]7:45[/TD]
[TD="class: xl77, align: center"]16:30[/TD]
[TD="class: xl68, align: center"]8.45[/TD]

[TD="align: center"]4[/TD]
[TD="class: xl69, align: center"]1[/TD]
[TD="class: xl74, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl71, align: center"]03-Aug-18[/TD]
[TD="class: xl70, align: center"]08:00[/TD]
[TD="class: xl70, align: center"]17:00[/TD]
[TD="class: xl78, align: center"]8:14[/TD]
[TD="class: xl78, align: center"]17:20[/TD]
[TD="class: xl68, align: center"]9.06[/TD]

[TD="align: center"]5[/TD]
[TD="class: xl69, align: center"]1[/TD]
[TD="class: xl74, align: center"]EMPLOYEE 1[/TD]
[TD="class: xl71, align: center"]04-Aug-18[/TD]
[TD="class: xl70, align: center"]08:00[/TD]
[TD="class: xl70, align: center"]17:00[/TD]
[TD="class: xl78, align: center"]7:45[/TD]
[TD="class: xl77, align: center"]16:14[/TD]
[TD="class: xl68, align: center"]8.29[/TD]

</tbody>
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Thank you steve, i express my apologies that, i did not read the post 8 carefully. It appears the "Total Hours" correct now. Many thanks for your time spent for my project. Have a great day!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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