Sunteți pe pagina 1din 5

5/26/2014

Linear Interpolation with Excel

Data Analysis

Dagra
Overview: digitizing graphs
Examples
Download
Buy

Excel
Linear interpolation
Arduino

MegunoLink
Uploading Programs
Serial Data Monitor
Plotting Arduino Data
Serial Monkey
Download

EmbeddedSand Resources
Libraries
Projects
Tutorials
Links
Report Templates

Technical Writing
Overview
Save Time with Templates
Writing tool bar

Word Templates
All
Technical Report
Simple Document
Downloads

by Blue Leaf Software


Dagra
MegunoLink
Word Templates for Technical Reports
Smorg: organize your Start Menu

Recommended for iOS


GridTimer: quickly schedule alerts
http://www.blueleafsoftware.com/Products/Dagra/LinearInterpolationExcel.php

1/5

5/26/2014

Linear Interpolation with Excel

ParkingAngel: no more parking tickets

Recommended Technical Tools


Technical Software
Technical Resources
Support
Contact us
Frequent Questions
Report a Bug
Suggest a Feature
Affiliate Programme
About us
Store
Buy Dagra
Buy Report Templates for Microsoft Word
Search

More
Share Like 32
Share Share
Home Products Dagra Linear Interpolation with Excel

Linear Interpolation with Excel


Many people want to interpolate data they have digitized with Dagra in Microsoft Excel.
Unfortunately Excel doesn't provide an interpolation function but there is a simple approach.
On this page:
Understanding interpolation
Linear interpolation
Implementation with Excel
How the Excel implementation works

Quick Links
Overview
Screenshots
Digitize PDF Graphs
Examples
Download trial
FAQ
Buy Now
Newsletter

Understanding Interpolation
Interpolation is a method for estimating the value of a function between two known values.
Often some relationship is measured experimentally or traced with Dagra at a range of values.
Interpolation can be used to estimate the function for untabulated points.

Download the Excel linear


interpolation example.

For example, suppose we have tabulated data for the thermal resistance of a transistor
tabulated for air velocity from 0 to 1800 FPM in 200 FPM steps. Interpolation can be used to
estimate the thermal resistance at non-tabulated values such as 485 FPM.

http://www.blueleafsoftware.com/Products/Dagra/LinearInterpolationExcel.php

2/5

5/26/2014

Linear Interpolation with Excel

The table lists thermal resistance in 200 FPM steps. Interpolation can be used to estimate the thermal
resistance for non-tabulated values.

Linear Interpolation
Linear interpolation involves estimating a new value by connecting two adjacent known values
with a straight line.
If the two known values are (x1, y1) and (x2, y2), then the y value for some point x is:

Linear interpolation is a straight line fit between two data points.

Note: Linear interpolation works best when the function is not changing quickly between
known values. It is probably not the best choice in this example because we don't have many
tabulated points. Dagra, however, will provide enough data points for accurate linear
interpolation.

Implementing Interpolation with Microsoft Excel


The linear interpolation equation above can be implemented directly in Microsoft Excel
provided the tabulated values are monotonic in x, that is the x-values are sorted and no two are
equal. The online Microwave Encyclopedia has the full 6 line implementation along with a good
explanation of how it works.
However, here is a simpler implementation for Excel:
=FORECAST(NewX,OFFSET(KnownY,MATCH(NewX,KnownX,1)-1,0,2),
http://www.blueleafsoftware.com/Products/Dagra/LinearInterpolationExcel.php

3/5

5/26/2014

Linear Interpolation with Excel

OFFSET(KnownX,MATCH(NewX,KnownX,1)-1,0,2))
To use it either:
1. Copy the formula above into Excel and replace KnownX and KnownY with the cell
reference for the tabulated x and y values and NewX with the x-value to interpolate,
OR
2. Define names for the KnownX and KnownY ranges
(InsertNameDefine...in Excel 2003) and replace NewX with the xvalue to interpolate.
You can download the Excel linear interpolation example.
This equation works exactly the same way as the direct implementation of the linear
interpolation equation. The main difference is that only two lookup functions are required for
the simple approach described here, while the direct implementation needs 6: one for each
term in the equation.

How the Excel implementation works


The simple implementation is easiest to understand by dissecting from the outside and working
in. Here's the full equation:
=FORECAST(NewX,OFFSET(KnownY,MATCH(NewX,KnownX,1)-1,0,2),
OFFSET(KnownX,MATCH(NewX,KnownX,1)-1,0,2))
In brief, the equation consists of 3 parts:
1. the FORECASTfunction to calculate the linear interpolation,
2. two calls to the MATCHfunction to find the tabulated x-value closest too, but less than
the new-x value, and
3. two calls to the OFFSETfunction to reference the tabulated x-values and y-values just
above and just below the new-x value.
In more detail, the FORECASTfunction performs the actual interpolation using the linear
interpolation equation shown above. Its syntax is: FORECAST(NewX,
known_y_pair, known_x_pair).
The first parameter, NewXis simply the value to interpolate. The next two parameters,
known_y_pairand known_x_pairare the values either side of NewX. That is, {x1,
x2} and {y1, y2} in the diagram above.
The MATCHfunction is used to find the tabulated x-value just below NewX. Its syntax is:
MATCH(lookup_value, lookup_table,match_type). MATCHreturns the
relative position of an item in a sorted array. So, lookup_valueis the value to interpolate,
lookup_tableis the array of KnownXvalues, and match_typeis 1 to find the
largest value in the array that is less than or equal to NewX.
The MATCHfunction returns an index, but the FORECASTfunction requires two cell ranges:
one for the known_x_pairand one for the known_y_pair. So, the OFFSET
function is used twice to create these ranges. Its syntax is OFFSET(reference,
row_offset, column_offset, row_count,column_count). It takes a
starting point, the reference, and creates a cell reference with the given offset and size. To
obtain the known_y_pairrange, the referenceis set to the table of KnownYvalues;
for the known_x_pairrange, referenceis set to the array of KnownXvalues. If the
tabulated values are arranged vertically, the row_offsetis the result from the MATCH
http://www.blueleafsoftware.com/Products/Dagra/LinearInterpolationExcel.php

4/5

5/26/2014

Linear Interpolation with Excel

function less 1 and row_countis 2; column_offsetis 0 and column_countis


1. This gives us a cell array reference 2 cells high and 1 cell wide. If the tabulated values are
arranged horizontally, row and column are switched in the OFFSETfunction.
2013 Blue Leaf Software Ltd. All rights reserved.

http://www.blueleafsoftware.com/Products/Dagra/LinearInterpolationExcel.php

5/5

S-ar putea să vă placă și