You are on page 1of 12

11/25/2017 Linear Interpolation in Excel | EngineerExcel

(http://www.engin
eerexcel.com/)

LINEAR INTERPOLATION IN EXCEL

 S 9 S 0  Tweet  Share S 0  P 0

So far in posts on looking up tabular data in Excel (http://www.engineerexcel.com/using-


excel-vlookup-to-pull-tabular-data-into-calculations/), I’ve focused on how to extract
known x- and y-values from a table. But what if the data in the table is too “coarse” and
you need better accuracy? Well, it’s also possible to perform linear interpolation in Excel,
which enables you to estimate a y-value for any x-value
(http://www.engineerexcel.com/2-ways-to-show-the-position-of-a-data-point-on-the-x-
and-y-axes-of-a-scatter-chart/) that is not provided explicitly in the data.

Linear Interpolation Background


In order to perform a linear interpolation in Excel, we’ll use the equation below, where x is
the independent variable and y is the value we want to look up:

Want to learn even more about advanced Excel techniques? Watch my free training just
for engineers (http://www.engineerexcel.com/free-training). In the three-part video series
I'll show you how to solve complex engineering challenges in Excel. Click here to get
started. (http://www.engineerexcel.com/free-training)

http://www.engineerexcel.com/linear-interpolation-in-excel/ 1/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

This method assumes that the change in y for a given change in x is linear.

In most cases this will provide results that are su ciently accurate. However, if you need
even greater accuracy, you may want to consider a more advanced method such as cubic
splines (https://newtonexcelbach.wordpress.com/2009/07/02/cubic-splines/).

MATCH and INDEX Functions


As shown in the equation above, we’ll need to nd the values of x1, y1, x2, and y2. To nd
these, we’ll use the MATCH and INDEX functions.

I wrote about the syntax for these functions here (http://www.engineerexcel.com/excel-


index-match-functions-look-up-engineering-data/), so if you need a refresher be sure to
check that out. But basically, MATCH returns the location of a value (n) in a column or row
of data. INDEX returns the actual value in the nth position of a row or column of data.

By using these functions together, we can extract the values of x1, y1, x2, and y2 we need
for the interpolation.

Linear Interpolation in Excel


Let’s take a look at how to perform this analysis on some real data.

http://www.engineerexcel.com/linear-interpolation-in-excel/ 2/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

The table below lists air density as a function of temperature in 20 degree Celsius
increments. If we want to get data at any temperatures other than those in the rst
column, we’ll have to interpolate.

If we want to estimate the density at 53 degrees Celsius, we need Excel to nd the values
x1 = 40, y1 = 1.127, x2 = 60, and y2 = 1.067 in the table. Then we can use these values in the
equation above.

Find the value of x1 with the following formula:

http://www.engineerexcel.com/linear-interpolation-in-excel/ 3/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

I’ve given cell C2 the name “x” in this example. This formula returns 40, which is the
greatest temperature that is less than 53, our x-value.

Next, we can get y1 with the following formula:

http://www.engineerexcel.com/linear-interpolation-in-excel/ 4/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

This equation is very similar to that used for x1. I used the MATCH function to return the
position of the greatest x-value that is less than “x” just as before. But rather than looking
for the value in that position of the temperature data, I returned a value from the column
of density data instead.

Now, to get x2 and y2, we will use basically the exact same formulas with a slight
di erence. We’ll add 1 to the value returned by MATCH to get 60 for x1 and 1.067 for y.

http://www.engineerexcel.com/linear-interpolation-in-excel/ 5/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

Now, it’s just a simple matter of entering the formula for linear interpolation into the
appropriate cell. I’ve used Named Ranges here again to make the formula clearer.

http://www.engineerexcel.com/linear-interpolation-in-excel/ 6/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

The formula returns 1.088. As a quick check to see if this makes any sense, we can plot it on
a curve of the known data:

Looks good!

The great thing about setting the formulas up in this way is that you can interpolate
correctly between ANY pair of tabulated x- and y- values.

http://www.engineerexcel.com/linear-interpolation-in-excel/ 7/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

Wrap-Up
So there you have it, a method to perform linear interpolation in Excel. Of course, this isn’t
the only method, but I think it’s probably the most straightforward one. Do you have a
preferred method? Let me know in the comments below.

 S 9 S 0  Tweet  Share S 0  P 0

ABOUT ME: CHARLIE YOUNG, P.E.

http://www.engineerexcel.com/linear-interpolation-in-excel/ 8/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

I’m a licensed professional engineer with a degree in Mechanical Engineering and over a
decade of practical experience building engineering applications in Excel. My goal is to
help you learn how to turn Excel into a powerful engineering tool.
If you’re interested in learning more, click the button below to receive an update whenever
I have a new tip to share. I’ll also send you a copy of my free eBook “10 Smarter Ways to
Use Excel for Engineering”.

Subscribe Now
(https://highcreekdigital.leadpages.co/leadbox/1408ef173f72a2%3A167484d6ef46dc/57

SOCIAL FREE TRAINING NAVIGATION SUPPORT

See what's up by Home About Support Terms


following along on (Http://Www.Engineerexcel.Com/)
(Http://Www.Engineerexcel.Com/About/)
(Http://Www.Engineerexcel.Com/Custom
(Http://Www.Engineerexcel.C
social media. Support/)
Excel Tips Free Training
(http://www.engine (Http://Www.Engineerexcel.Com/Blog/)
(Http://Www.Engineerexcel.Com/Free-
Privacy
erexcel.com/free- Training/) (Http://Www.Engineerexcel.Com/Privacy
training)
Resources Learn More
(Http://Www.Engineerexcel.Com/Resources/)
(Http://Www.Engineerexcel.Com/Join/)

http://www.engineerexcel.com/linear-interpolation-in-excel/ 9/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

Login
(h (h (h (h
tt tt tt tt (h (Https://Learn.Engineerexcel.Com/Login)
p: p: p: ps tt
// // // :/ p:
w w w /t //
w w w w w
w. w. w. itt w
e fa e er w.
n ce n .c y
gi b gi o o
n o n m ut
e o e /e u
er k. er n b
ex c ex gi e.
ce o ce n c
l.c m l.c e o
o /e o er m
m n m _ /c
/j gi /f ex h
oi n e ce a
n/ e e l) n
) er d/ n
se ) el
xc /
el U
/) C
c
V
H
L
Z
AI
H
ur
3S
32
y
_
q
M
u
D
z
Q
)

http://www.engineerexcel.com/linear-interpolation-in-excel/ 10/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

Copyright © 2017 EngineerExcel.com · Log in (http://www.engineerexcel.com/wp-login.php)

http://www.engineerexcel.com/linear-interpolation-in-excel/ 11/12
11/25/2017 Linear Interpolation in Excel | EngineerExcel

http://www.engineerexcel.com/linear-interpolation-in-excel/ 12/12

You might also like