Add FREE cubic spline functionality to Microsoft Excel...
SRS1 Cubic Spline for Excel adds cubic spline and linear interpolation functions to Microsoft Excel. A cubic spline smoothly interpolates between given data points. The download includes a newer .NET based version (v2.xx), and an older VBA version (v1.xx) of the product. The newer version requires Excel 2007 or later, but it runs faster and contains an additional linear interpolation function. The older version is based on Visual Basic for Applications and is compatible with all versions of Excel (Excel 95 or later).
The older version includes a sample workbook that demonstrates how the function works. It also includes a utility for exporting the function code to any open workook. Unfortunately, some security software might block this. This feature is useful if you are going to create a workbook that uses the cubic spline function, and then pass the workbook to someone else on another computer. The person who receives the file will not have to install anything on their computer in order for the cubic spline function to work. If you are using the newer (v2.xx) version of the product, then all users will need the product installed on their systems.
The download also includes an installer for a 30 fully functional trial of Data Curve Fit Creator Add-in, but it will not be installed unless you explicitly install it.
Operating Systems Supported: Windows 7, Vista, XP, Server 2008, Server 2003
For your support, see the downloaded workbook and the Frequently Asked Questions listed below here...
Frequently Asked Questions
(1) I noticed that there are three items in download of 'SRS1 Cubic Spline for Excel'. What are they?
The download includes the current version of 'SRS1 Cubic Spline for Excel' (version 2). This is probably the version that you would want to use, but it also includes an older version (Version 1.xx) and a fully functional trial version of Data Curve Fit Creator Add-in.
(2) Why would I want the older version of 'SRS1 Cubic Spline for Excel'?
The new version (Version 2) of the software requires Excel 2007 or later. It also runs faster, is more robust, and will have fewer issues with security software since it is a compiled .net add-in. If you have Excel 2003 or earlier, then you would need to use the earlier version. Also, the earlier version is written in VBA, so you can see the code within that version. One other benefit is that if you add the earlier version's VBA code to a workbook, and then give the workbook to someone on another machine, then they don't need to install anything to get the function to work.
(3) What functions are included in the software? How do I access them?
Version 2 has two functions: 'cubic_spline' and 'linear_interp'. These functions are listed under the 'SRS1Spline.Functions' function category in the 'Insert Function' dialog box of Excel. The older version (Version 1.xx) only has the 'cubic_spline' function, and it is listed under the 'User Defined' function category of the 'Insert Function' dialog. If 'SRS1 Cubic Spline for Excel' is installed, then if you type '=cubic_spline(' in a cell in Excel, then the Excel function wizard will list the arguments that you need to provide for the function.
(4) I am using the older version of the software, and when I click the 'Export Cubic Spline function to other open workbook' button then nothing happens.
A possible cause for this is that the Excel security settings are blocking macros from running on the workbook. Adjust the security settings to at least prompt and ask you whether you want to allow macros and/or VBA code to run. Do NOT just turn off all security settings, as this could potentially leave Excel unprotected from security threats.
(5) When I try to use the functions in Excel, I just get '#NAME?' shown in the cell instead of a result. What is this?
When you see '#NAME?' in an Excel cell, then it means that Excel does not recognize the function that you are trying to use. If you see this then you should first make sure that you are spelling the name of the 'SRS1 Cubic Spline for Excel' function correctly. The correct names are 'cubic_spline' and 'linear_interp'. If you are sure that you have the name correct, then that means that add-in is not installed or is not enabled. You can try installing the software again. If you are using the old version of the software (version 1.xx) then make sure that your security settings in Excel are set to allow the custom function to run.
(6) Can I use 'SRS1 Cubic Spline for Excel' and 'Data Curve Fit Creator' at the same time?
Yes, but 'Data Curve Fit Creator Add-in' has its own cubic spline and linear interpolation functions, as well as many more advanced functions and options. Note also that there is no function name conflict when you have both installed. 'SRS1 Cubic Spline for Excel' uses underscores in its function names ('cubic_spline', 'linear_interp'), but 'Data Curve Fit Creator Add-in' does not use underscores (e.g. 'CubicSpline', 'LinearInterp').
(7) How does a cubic spline work?
A cubic spline interpolates a smooth line through a given set of data points. Unlike a polynomial or other curve fits, a spline is forced to directly pass through all points in the data set. There are a few other constraints that are used to generate the smooth curve. Interpolating between two points, if we know the second derivative tat the first and second points, then the second derivative of the interpolated curve will vary linearly from the first to the second point. Also, the first derivative of the curve needs to be continuous across the curve.
(8) My cubic spline curve is very erratic and 'wobbles' quite a bit. How can I make the curve smoother?
As mentioned before, the cubic spline is forced to go through all data points. If there is noise in your data, then the curve can become erratic as it tries to smoothly pass through each point. Some things that you can do to improve the behavior of the curve include removing bad data points or smoothing the data before creating the spline.
(9) My spline curve does not pass through all my data points. Is something wrong?
Your source data input values (X values) need to be in ascending order, or else the function will not work correctly.
(10) What can I do to have more control over the shape of the curve generated by the cubic spline function?
This version of the cubic spline does not allow you to directly specify the slope at a data point. There is a kluge that you can try in order to achieve this, though. You can try to force the slope at a data point to be what you want by adding a fake data point right next to it at the desired slope. For example, to set the slope at point [x=1, y=6] to be zero, you could add a new data point [x=0.999, y=6], and then maybe one more at [x=1.001, y=6]. Again, this is definitely a kluge, but in some cases it could be useful. Note also that Data Curve Fit Creator Add-in includes a 'FlexSpline' function that lets you specify the slope at any point.
(11) Where else can I learn about implementing Cubic Splines?
We recommend the book 'Numerical Recipes: The Art of Scientific Computing, Third Edition (2007)', published by Cambridge University Press'. The code in SRS1 Cubic Spline for Excel is based on the cubic spline in that book.