Function Sati(V1 As Date, V2 As Date) As Date Dim Vr As Single If V1 > V2 Then V2 = V2 + 1 End If Do While V1 <= V2 If V1 >= "23:00" Or V1 <= "6:00" Then Vr = Vr + 0.001 End If V1 = V1 + 0.001 Loop Sati = Vr End Function