Place the following code in a standard module, and use like a user defined function.
Function Convert2Hours(rg As Range) As Double
Dim sArray() As String
Dim i As Long
Dim nValue As Long
Dim dbResult As Double
sArray = Split(rg.Text, ",")
For i = LBound(sArray) To UBound(sArray)
nValue = CLng(Val(sArray(i)))
If InStr(1, sArray(i), "minute", vbTextCompare) > 0 Then
dbResult = dbResult + nValue / 60
ElseIf InStr(1, sArray(i), "hour", vbTextCompare) > 0 Then
dbResult = dbResult + nValue
ElseIf InStr(1, sArray(i), "day", vbTextCompare) > 0 Then
dbResult = dbResult + nValue * 24
ElseIf InStr(1, sArray(i), "week", vbTextCompare) > 0 Then
dbResult = dbResult + nValue * (24 * 7)
End If
Next i
Convert2Hours = dbResult
End Function
Bookmarks