I have an Excel database with timestamps and I want to be able to count the number of times there is a lapse in a specified amount of time (ie., 5 mins.). Is there any way of doing this?
use the following function. Please note that this functions returns a text string therefore you can't use norman operator to work with the result. You can cast the result and work with that if you wish.
usage:
=timexx_subtract("01:04:02:52","00:00:00:70"
it will return 01:04:01:82
Ed
This function returns a text string, so you can't
Function TIMEXX_SUBTRACT(n1 As String, n2 As String, Optional fps As Double) As String
' Subtracts an TIMEXX code (n2) from an TIMEXX code (n1)
Dim h1 As Integer, m1 As Integer, s1 As Integer, x1 As Integer
Dim h2 As Integer, m2 As Integer, s2 As Integer, x2 As Integer
Dim h As Integer, m As Integer, s As Integer, x As Integer
Dim TotFrames As Double
Dim LeftOverFrames As Double
Dim fph As Double, fpm As Double
Dim NegFlag As Boolean, NegFlag1 As Boolean, NegFlag2 As Boolean
Dim Offset1 As Integer, Offset2 As Integer
Dim Frames1 As Double, Frames2 As Double
If fps = 0 Then fps = 100
' Treat blanks as zero
If n1 = "" Then n1 = "00:00:00:00"
If n2 = "" Then n2 = "00:00:00:00"
If Len(n1) = 12 Then
Offset1 = 1
NegFlag1 = True
Else
Offset1 = 0
NegFlag1 = False
End If
If Len(n2) = 12 Then
Offset2 = 1
NegFlag2 = True
Else
Offset2 = 0
NegFlag2 = False
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.