GomezAddamz
Technical User
I'm having trouble with an Excel VBA formula and have isolated the cause. I have a worksheet with the times 17:00, 13:10, 4:10, and 8:00 in columns A, B, C, and D respectively. In column E, I have the excel formula "=IF(A1-B1+C1=D1,"True","False")", which returns "True". In column F, I have "=Test(A1,B1,C1,D1)", which returns "FALSE". Does anyone know why these two functions would give different results? Any and all help is greatly appreciated, thanks!
Code:
Function Test(A As Double, B As Double, C As Double, D As Double) As Boolean
If (A - B + C = D) Then
Test = True
Else
Test = False
End If
End Function