With OR and AND functions, you need to test both indivifually like so
SUMPRODUCT is an array formula, so you cannot use Applictaion, you have to evaluate itIf output = "M1" Or output = "M" Then
M1 = Application.Evaluate("SumProduct(" & Prob & "," & Val & ")")