Stringmaker
Mechanical
- Mar 18, 2005
- 513
Hi All,
I have a dilemma of sorts on my hands. I have a series of points the compose a piecewise function. Say I have the following points data as a column vectors
X Y
1.1 10
2.3 20
9.8 30
12.4 40
15.2 50
What I need to do is interpolate linearly inbetween these values for other given values. Say for instance I have a value, Xi=5.4. I want to interpolated between X=2.3 and X=9.8 to determine Yi(5.4). My data is in acscending order as shown above and I have been successful in getting the lower value by using the lookup function, for instance LOOKUP(5.4,A1:A5,A1:A5) would return 2.3 in my case. But I am having trouble obtaining the upper value of 9.8 since my data is ascending. Can anyone help me with this? Ultimately I'd like to if possible accomplish the entire interpolation in once cell. Is this possible? I'm stuck now.
Thanks in advance!
-Brian
I have a dilemma of sorts on my hands. I have a series of points the compose a piecewise function. Say I have the following points data as a column vectors
X Y
1.1 10
2.3 20
9.8 30
12.4 40
15.2 50
What I need to do is interpolate linearly inbetween these values for other given values. Say for instance I have a value, Xi=5.4. I want to interpolated between X=2.3 and X=9.8 to determine Yi(5.4). My data is in acscending order as shown above and I have been successful in getting the lower value by using the lookup function, for instance LOOKUP(5.4,A1:A5,A1:A5) would return 2.3 in my case. But I am having trouble obtaining the upper value of 9.8 since my data is ascending. Can anyone help me with this? Ultimately I'd like to if possible accomplish the entire interpolation in once cell. Is this possible? I'm stuck now.
Thanks in advance!
-Brian