Function fun(a As Double) As Double a = Int(a) If a > 1 Then fun = 2 For i = 4 To Int(a / 2) * 2 Step 2 fun = fun * i NextEnd Function