With OR and AND functions, you need to test both indivifually like so

If output = "M1" Or output = "M" Then
SUMPRODUCT is an array formula, so you cannot use Applictaion, you have to evaluate it

M1 = Application.Evaluate("SumProduct(" & Prob & "," &  Val & ")")