Professional Documents
Culture Documents
Interpolation
Interpolation
There are a few different types of interpolation techniques. One relies on creating a curve of
best fit taking into account the entire data set. This is addressed in the topic Trendline
Coefficients and Regression Analysis. Another technique uses piecewise linear
interpolation. As the name implies it fits a straight line to each consecutive pair of data
points and uses the appropriate straight line for interpolation. It is this technique that is
discussed in this section. Other techniques rely on smooth curves that pass through all the
data points. These typically are Cubic Spline or Bezier curves and are outside the scope of
this section.
Figure 1 Figure 2 --
Each consecutive pair of points is connected by a straight
line
Also, suppose that the ranges containing the X and Y values are named XVals and YVals
respectively. If necessary, use Insert | Name > Define... to name cell ranges.
The basics
Using linear interpolation, given any two points (x0, y0) and (x1, y1) and the value x2, where
x0≤x2≤x1 the corresponding y2 value is given by
For example, given two data points (x0, y0) = (10.75, 25.003) and (x1, y1) = (30.8, 33.33) the y
value that corresponds to the x-value given by x2 = 11 would be
Use the MATCH function to find which x-value corresponds to x0 for this targetVal.
Name the cell containing the formula with the MATCH function as MatchIdx.
This is the index into the XVals range that corresponds to the x0 value. The index for the x1
value, will be one greater than MatchIdx. The actual x0 value is given by INDEX(XVals,
MatchIdx) and the x1 value by INDEX(XVals, MatchIdx+1)
The corresponding y values, i.e., y0 and y1, are the same indices applied to the YVals range:
INDEX(YVals, MatchIdx) and INDEX(YVals, MatchIdx+1)
Alternative formulations
It is possible to simplify the analysis with other built-in Excel functions. The FORECAST
function is normally used for interpolation with an entire data set. However, if its arguments
are only two data points, its result will be the same as a piecewise linear interpolation.
One can also use the OFFSET function to further simplify the formula.