A few comments:
The first Google hit on "Akima spline" is:
http://www.alglib.net/interpolation/spline3.php and this is useful for those trying to implement the routines when they didn't write them :)
The Akima spline gives results very close to the Matlab output.
The cubic spline in the posted spreadsheet is constrained to a slope of 1 at both ends, so it oscillates at the ends.
Spline1DBuildCubic X, Y, 21, 1, 1, 1, 1, C3
A better fit is given by setting the end curvature to zero:
Spline1DBuildCubic X, Y, 21, 2, 0, 2, 0, C3
And a few suggestions on the VBA code:
Dim I, J As Integer
creates I as a variant and J as an integer, which is presumably not what was intended. Also note that VBA converts intergers to longs anyway, and takes time doing this, so the more efficient code is:
Dim I as long, J as long
Writing to the spreadsheet one cell at a time really slows things down. It is better to write all the results to an array then write that to the spreadsheet in one operation. Similarly it is better to read input data into a variant array rather than read one cell at a time e.g.:
Dim CubResA(1 to 2000, 1 to 1) as double
Dim XI As Variant
..
XI = Range("c2:C2001").Value2
Spline1DBuildCubic X, Y, 21, 2, 0, 1, 0, C3
For J = 1 To 2000
CubResA(J, 1) = Spline1DCalc(C3, XI(J, 1))
Next J
Range("e2:e2001").Value2 = CubResA
That approach reduces the time for calculation of the cubic and akima splines for 2000 values from 0.3 seconds to 0.03 seconds.
Also in practice it is better to use range names rather than specific cell addresses, see here:
http://newtonexcelbach.wordpress.com/20 ... orrection/