Hello Everyone,

I am trying to define a Function on excel depending on the variable x.

I wrote this code:

Function F(x As Double) As Double



Select Case x
Case Is < 0: F = -Sin(x)
Case 0 To 2: F = 2 * x
Case 2 To 4: F = x ^ 2
Case Else: F = 16
End Select
End Function

But the only results I get are those ones:
Capture.PNG

Would you have some idea on what I did wrong?

Thanks in advance!

Edmond