In my previous post on splines I described a quick and dirty approach to adjusting a cubic spline to fit monotonic data, which did not meet with universal approval, so I have followed up Mike Woodhouse’s link: (http://en.wikipedia.org/wiki/Monotone_cubic_interpolation) which gives a more mathematically correct procedure.
I have added three new functions to the spreadsheet CSpline2.xls, including full open source code.
The functions are: CHSplineA
CHSplineA fits a Cubic Hermitic Spline curve through a series of XY points, with the option to force monotonic output. Typical input and output is shown below:
The Cardinal Spline allows functions with non-monotonic X values. There are three options for the interpolation points; either An L value (specifying a segment number and position of the point along the segment length), or X or Y values.
Finally I have adapted Lori Miller’s code to extract XY data from chart series, the main change being to convert it into an array function, which should improve performance: