Post hours and minutes (not time)

Livin404

Well-known Member
Joined
Jan 7, 2019
Messages
743
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Greetings, In Column F on a worksheet I'm trying to get Column F to be expressed in terms of hours and minutes. For example 1 and 45 mintues. I would like it to read 1.45. If something takes 2 hours and 8 minutes. It would be entered as 2.08. The minutes can only go up to .59. Eventually these time durations will be be added together. For example1.45 and 2.08 would be 3.53. Naturally if the number goes over 59 than the hour will be increased. I already set Column F with a Custom number h:mm. I tried to use the following VBA but I"m afraid I'm falling well short of the mark. Any help would be greatly appreciated.

VBA Code:
Sub elapsedtime()

Dim rng As Range
Set rng = ActiveSheet.Range("F2:F500") '.SpecialCells(xlConstants, xlNumbers)
For Each c In rng
 If c.Value >= 1 And Int(c.Value) = c.Value Then _
 c.Value = (c.Value / 86400)
Next c
Columns("D:D").Select
Selection.NumberFormat = "mm:ss.0"

End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Are you entering proper times originally? A method that I've used previously. Not that these will not work if the times include seconds.
Single time
Excel Formula:
=DOLLARFR(A1*24,60)
Adding multiple times
Excel Formula:
=DOLLARFR(SUM(A1:A2)*24,60)
 
Upvote 0
you are better off using decimals like 1.75 for 1 hour and 45 minutes. How is your time displayed?
 
Upvote 0
Are you entering proper times originally? A method that I've used previously. Not that these will not work if the times include seconds.
Single time
Excel Formula:
=DOLLARFR(A1*24,60)
Adding multiple times
Excel Formula:
=DOLLARFR(SUM(A1:A2)*24,60)
Thank you for getting back. I will not be using a start and finish time to get the time. Basically, the indiviual will keep track of the time themselves. I sooner use the hours and minutes rather than percentages. There are a lot of people who will need to keep track of this, and it will be a tall order for one to put something like. .75 or 90 minutes etc. I have to take this to the low end of the smart scale. I provided a image where he the individual will place the amount of time taken to complete an inspecion.

Thank you

time.PNG
 
Upvote 0
Sorry, I had read the question backwards. I was going from a time entered as hh:mm to a decimal rather than a time entered as decimal to hh:mm.
Excel Formula:
=DOLLARDE(D1,60)/24
will convert 1.45 to 01:45, 2.08 to 02:08, etc. As before, this is for hours and minutes only, it will not work with seconds.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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