Ok the error says:
#ERROR! TypeError: Math.Log is not a function (Line 11)
Here is the code now:
/**
* Find Lot Midpoint value. (Start, End, Total, Slope)
* @param {number} Start The Start QTY of lot.
* @param {number} Last The Finish QTY of lot.
* @param {number} Total The Total QTY of lot.
* @param {number} Slope The Slope of the Curve.
* @return The calculated cost change.
* @customfunction
*/
function Midpoint(Start, End, Total, Slope) {
return (((1 / (1 + (Math.Log(Slope) / Math.Log(2)))) * ((Last + 0.5) ** (1 + (Math.Log(Slope) / Math.Log(2))) - (First - 0.5) ** (1 + (Math.Log(Slope) / Math.Log(2))))) / Total) ** (1 / (Math.Log(Slope) / Math.Log(2)));
}
Ok so, to summarise:
a**b
;Math.log
;Math.log
is not the same as Math.Log
, which indeed is not a function.