**XlXtrFun.xll** is a collection of functions which extends the capabilities of Microsoft Excel; developed primarily to facilitate, interpolation of 2-dimensional and 3-dimensional data, and simplify 2-variable curve fitting. XlXtrFun has been used for years by engineering and research and development personnel on every continent who need to interpolate, extrapolate, and curve fit data rapidly, reliably, and with a virtually non-existent learning curve.

**If you work with real-life data and want to interpolate, extrapolate, or curve fit, then you will find these functions very useful.**

"There is a great satisfaction in building good tools for other people to use."

Freeman Dyson (b. 1923); British-born U.S. physicist, author.

From a user in Minano, Italy: "Your functions have become very popular in the last two or three years, and it would be tough to abandon them."

Using *Spline()*, *Interpolate()*, *Intersect()*, *dYdX()*, and *ddYdX()* functions.

Example of the use of *Spline()*, *Interp()*, and *Interpolate()* functions.

- Fast, reliable interpolated and extrapolated values in two and three dimensions.
- Three dimensional interpolation and extrapolation using either a set of (x, y, z) points, or matrix of evenly spaced z values.
- If the default method of interpolation and extrapolation is unsuitable, it can be controlled using function arguments which can be cell references. The interpolation and extrapolation method can therefore be easily changed and results can be viewed instantly.
- Polynomial curve fit using the least squares method (up to about order 49) without building elaborate matrices. Order of fit is a function argument which can also be a cell reference. Thus the order of fit can be changed by changing the value in a single cell, so the suitability of fit can be seen instantly.
- Find interpolated or extrapolated intersection of two curves defined by two sets of (x, y) points.
- Find the smoothed curve (constant first derivative) minimum and maximum values of functions defined by a set of (x, y) points.

XlXtrFun has been used for years by engineering and research and development personnel in Europe, South America, and North America who need to interpolate, extrapolate, and curve fit data rapidly, reliably, and with a virtually non-existent learning curve. As the *Spline()* function example above shows, you define your curve in the first two function arguments by giving it some x's and an equal number of y's. The next argument is the x for which you want the interpolated value, and the function returns the y at that x. We can't imagine an easier way to do things.

The functions also allow for overriding the various default methods of the functions by specifying values for the optional arguments.

Most functions also have exported versions for use by Visual Basic for Applications within the Excel Visual Basic programming environment. Exported versions are also available for "pure" Visual Basic, C, C++, FORTRAN, etc.

- LookupClosestValue
- Returns the element in an array which is closest to a given value
- IndexOfClosestValue
- Returns the 1-based index of the element in an array which is closest to a given value

- LookupClosestValue2D
- Returns the element in a 2-D array which is closest to two given values
- Pfit
- Returns the Y which lies on the polynomial line fit by the least squares method
- PfitData
- Returns the coefficients and statistics for the polynomial line fit by the least squares method
- Spline
- Returns the Y which lies on the cubic (or natural) spline curve at the given X
- Interpolate
- Returns the Y which lies on an interpolated curve at the given X
- Interp
- Returns the Y which lies on an interpolated curve at the given X using the defaults of Interpolate
- XatY
- Returns the X value at the Max. (Peak),. Min (Valley), or Given Y of an interpolated curve
- Intersect
- Returns the X value at the intersection of two lines defined by arrays of points
- ddydx
- Returns the second derivative of the interpolated curve at the given X using the defaults of Interpolate
- dydx
- Returns the first derivative of the interpolated curve at the given X using the defaults of Interpolate

- Interp3D
- Returns an interpolated Z for known X's, known Y's, known Z's, and a given X and Y using the defaults of Interpolate
- InterpMatrix
- Given an X, Y, Z matrix like an efficiency hill curve matrix, interpolates or extrapolates a Z using the defaults of Interpolate

Note: 3-D Interpolation from __ordered__ input data is part of XlXtrFun and is what the previous two functions do. ** Surface Generation from Scattered Input Data** is now released and included in the zip file. Feel free to
email me
with any questions regarding using these routines.

- InputByte
- Inputs a byte from a given I/O port
- OutputByte
- Outputs a byte to a given I/O port

- Computer:
- 486DX PC or above.
- Memory:
- Sufficient for Windows.
- Disk Space:
- 0.5 MB
- Operating System:
- Windows 95, 98, Me, NT 3.51, NT 4.0, 2000, XP.
- Other Software:
- Microsoft Excel for Windows 95/97/2000/XP. To use exported functions only, Microsoft Excel is not required.

Red Lion, PA 17356

email: support@xlxtrfun.com

http://www.xlxtrfun.com/XlXtrFun/XlXtrFun.htm

All specifications subject to change without notice.

XlXtrFun is a trademark of Advanced Systems Design and Development.

Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.