Interpolation Visual Basic Macro!!!!

L

L. Tucker

I have two columns of data (let's call them x and y). Now
I have a x-value in another cell somewhere in the range of
the x data and I want an interpolated y-value as an
output. Please help! I'm sure there is a visual basic
macro that can be written for this, but cannot figure out
how to do it. Could anyone please help?!?!? Thanks so much.
 
J

Jerry W. Lewis

Agreed that more info is needed (type of interpolation, is data sorted,
etc.), but regression is not interpolation. Interpolation passes
through the data points; regression passes near them, but does not
necessarily pass through any data points.

Jerry
 
L

L. Tucker

Sorry for the lack of info... To be more specific, I have
one column of temperatures in ascending order (i.e. 20-700
deg C, in increments of ~50 deg C) and another column(s)
of corresponding material data for each temperature point.
Now I want to output data for a specific temp that falls
w/i the data that I have... let's say for 48.5 deg C for
example. I only need a linear interpolation function or
macro. Can anyone please help me with this? Thanks so much
for your replys so far.
Leslie
 
J

Jerry W. Lewis

For concreteness, I will assume that the temperatures are in A1:A15, the
material data are in B1:B15, and that D2 contains the specific
temperature for which you want to interpolate a value.

=FORECAST(D2,OFFSET($B$1:$B$15,MATCH(D2,$A$1:$A$15)-1,0,2),OFFSET($A$1:$A$15,MATCH(D2,$A$1:$A$15)-1,0,2))

should do the trick. It depends critically on the temperatures being in
ascending order, and there being no blank cells in either the
temperature or the material data ranges.

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top