Hi
well i want to calculate the number of minutes present in this time ( 23:45:06 )
this is time is in one cell .. i need a formula to put in another cell so that i can get the total number of minutes
Regards
Printable View
Hi
well i want to calculate the number of minutes present in this time ( 23:45:06 )
this is time is in one cell .. i need a formula to put in another cell so that i can get the total number of minutes
Regards
Something along these line:
VB Code:
MsgBox DateDiff("s", "00:00:00", "23:45:06")
Yeilds: 85506 (Seconds sine midnight).
Here is a step-by-step process to help you understand what you are trying to do ... convert a Date/Time value to a floating point number:
daysInteger.dayFraction
If daysInteger is 0, then the dayFraction * 24 = Hours and dayFraction * 24 * 60 = Minutes.Code:Option Explicit
Sub Macro1()
Dim aTime As Date
Dim myHours As Double
Dim myMinutes As Double
'Initialize a Date/Time value
aTime = "23.49.22"
'Convert to Hours and Minutes
myHours = CDbl(aTime) * 24# ' 24# = 24.0
myMinutes = myHours * 60# ' 60# = 60.0
'Here are the results
MsgBox myHours & " " & myMinutes
End Sub
B4 holding the time.Code:=(HOUR(B4)*60)+MINUTE(B4)+(SECOND(B4)/60)
Wasn't a coding question - sounds more like a classroom question - using normal functions.
Code:
(same as webtests! - :) sorry!)Code:?cdbl(cdate("23:45:06"))*24*60