Function ValuePL(x, Xi, Vi) i = 2 Do While x > Xi(i) i = i + 1 Loop ValuePL = Vi(i - 1) _ + (Vi(i) - Vi(i - 1)) * (x - Xi(i - 1)) / (Xi(i) - Xi(i - 1)) End Function Function ValueE(x, Low, High, Monotonicity, Rho) Select Case UCase(Monotonicity) Case "INCREASING" Difference = x - Low Case "DECREASING" Difference = High - x End Select If UCase(Rho) = "INFINITY" Then ValueE = Difference / (High - Low) Else ValueE = (1 - Exp(-Difference / Rho)) / (1 - Exp(-(High - Low) / Rho)) End If End Function Function CEValue(RhoM, Weight, Pi, Vi) If UCase(RhoM) = "INFINITY" Then CEValue = Weight * Application.SumProduct(Pi, Vi) Else EV = 0 For i = 1 To Application.Count(Pi) EV = EV + Pi(i) * Exp(-Weight * Vi(i) / RhoM) Next i CEValue = -RhoM * Log(EV) End If End Function Function Quad(x, Xi, Yi) Xnorm = (x - Xi(1)) / (Xi(3) - Xi(1)) Xm = (Xi(2) - Xi(1)) / (Xi(3) - Xi(1)) Ym = (Yi(2) - Yi(1)) / (Yi(3) - Yi(1)) a = (Ym - Xm) / (Xm * Xm - Xm) b = 1 - a Ynorm = a * Xnorm * Xnorm + b * Xnorm Quad = Yi(1) + Ynorm * (Yi(3) - Yi(1)) End Function