Hi there,

Got two problems in one little segment of code!

I want to enter the IF statement "If" output is "M1" or "M2" what syntax should I be using.

Also I want to be able to use SUMPRODUCT in VBA but it does not seem to work the program just stops when I try to call it? Again what syntax should I use?

If output = ("M1" Or "M") Then
Dim Prob() As Double
ReDim Prob(N)
For i = 1 To N
    Prob(i) = Application.Max(p2 ^ i * (1 - p2) ^ (N - i))
Next i
M1 = Application.SumProduct(Prob, Val)
M2 = Application.SumProduct(Prob, Val ^ 2)
End If
Thanks

Baz