Linear Interpolation in Excel - EngineerExcel

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

(https://www.

engi
neerexcel.com/)

LINEAR
INTERPOLATION IN
EXCEL
 Share S 0  Tweet  Share

S 0  P 0

So far in posts on looking up tabular data in


Excel
(https://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
(https://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.

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 1 of 15
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:

[Note: Want to learn even more about


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

Excel Course for


Engineers
https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM
Page 2 of 15
Engineers
Learn advanced engineering
techniques in Excel with this limited
time free video course. Click the
button below to get started today.

()GET STARTED

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/).

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 3 of 15
2009/07/02/cubic-splines/).

MATCH and INDEX


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

I wrote about the syntax for these


functions here
(https://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

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


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

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
first column, we’ll have to interpolate.

If we want to estimate the density at 53


degrees Celsius, we need Excel to find 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:

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 5 of 15
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.

[Note: Want to learn even more about


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

Excel Course for


Engineers
https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM
Page 6 of 15
Engineers
Learn advanced engineering
techniques in Excel with this limited
time free video course. Click the
button below to get started today.

()GET STARTED

Next, we can get y1 with the following


formula:

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

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 7 of 15
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.

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 8 of 15
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.

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:

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 9 of 15
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.

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 10 of 15
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.

[Note: Want to learn even more about


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

Excel Course for


Engineers
https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM
Page 11 of 15
Engineers
Learn advanced engineering
techniques in Excel with this limited
time free video course. Click the
button below to get started today.

()GET STARTED

 Share S 0  Tweet  Share

S 0  P 0

ABOUT ME: CHARLIE


YOUNG, P.E.
I’m a licensed professional engineer with a
degree in Mechanical Engineering and over
a decade of practical experience building

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 12 of 15
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

SOCIAL FREE NAVIGA SUPPOR


COURSE TION T
See
what's up Support
Terms
by (Https://Www.engineerexcel.com/Customer-
(Https://Www.engineerexcel.com/Terms/)
(https:// Support/)
following
www.eng
along on
ineerexce Privacy
social
(Https://Www.engineerexcel.com/Privacy/)

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 13 of 15
media. l.com/freeHomeAbout
-course) (Https://Www.engineerexcel.com/)
(Https://Www.engineerexcel.com/About/)

Free Course
Excel Tips
(h (h (h
tt tt tt (Https://Www.engineerexcel.com/Free-
(Https://Www.engineerexcel.com/Blog/)
ps ps ps Course/)
:/ :/ :/
/ / /
w w w Resources
Coupon
w w w (Https://Www.engineerexcel.com/Resources/)
(Https://Www.engineerexcel.com/Excel-
w. w. w.
e fa e Master-Class-For-Engineers-Coupon-
n ce n Code/)
gi b gi
n o n
e o e Login
er k. er (Https://Learn.engineerexcel.com/Login)
ex c ex
ce o ce
l.c m l.c
o /e o
m n m
/j gi /f
oi n e
n/ e e
) er d/
se )
xc
el
/)

(h (h
tt tt
ps ps
:/ :/
/t /
w w
itt w
er w.
.c y
o o
m ut
/e u
n b
gi e.
n c

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 14 of 15
n c
e o
er m
_ /c
ex h
ce a
l) n
n
el
/
U
C
c
V
H
L
Z
AI
H
ur
3S
32
y
_
q
M
u
D
z
Q
)

Copyright © 2019 EngineerExcel.com · Log


in (https://www.engineerexcel.com/wp-
login.php)

https://www.engineerexcel.com/linear-interpolation-in-excel/ 12/5/19, 2:07 AM


Page 15 of 15

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy