This semiautomated approach is included in the sample file mentioned above. These are the necessary worksheet formulas:
C3 =IF(A3<>"",(B3B2)/(A3A2),"") [copy down as far as necessary] D3 =IF(A3<>"",B2C3*A2,"") [copy down] E2 =COUNT(A:A) E4 =AND(C3:INDEX(C:C,E2)<=C4:INDEX(C:C,E2+1)) [Array formula] E6 =AND(C3:INDEX(C:C,E2)>=C4:INDEX(C:C,E2+1)) [Array formula] F4 =REPT("=MAX(F2*{"&sbCat(C3:INDEX(C:C,E2+1))&"}+{"&sbCat(D3:INDEX(D:D,E2+1))&"})",E4) F6 =REPT("=MIN(F2*{"&sbCat(C3:INDEX(C:C,E2+1))&"}+{"&sbCat(D3:INDEX(D:D,E2+1))&"})",E6) F7 =REPT("No solution: slopes need to increase or to decrease monotonously!",NOT(E4+E6)) F9 =IF(E4,sbEval(F4),IF(E6,sbEval(F6),"")) [sbEval is similar to sbLockedFormula]
