A formula/sub to turn HH:MM into decimal values...

MDodd73
03-26-2003, 02:03 PM
Is there a formula to either

a.) Convert H:M into a decimal format (1:30 --> 1.5) so as to calculate an employee's time spent doing this or that?

Wamphyri
03-26-2003, 02:22 PM
Yes. Time is stored as a decimal value of 24 hours. So multiply it by 24 hours to get an Hour.(Minutes/60) double.

'If cell A1 = 1:30 then cell B1 = 1.5
'get decimal value of Time and mult by 24
Cells(1, 2).Value = CDbl(Cells(1, 1).Value) * 24
ActiveSheet.Columns(2).NumberFormat = "#0.0"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum