View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve J. Vaughan Steve J. Vaughan is offline
external usenet poster
 
Posts: 5
Default Approximating a curve

Thanks Joe, That is what I am attempting to do.

I managed it with using slope & intercept and a vlookup table once I got my
head in gear this morning.

Thanks again

" wrote:
[i]
Steve J. Vaughan wrote:
what I am trying to do assume a
straight line between the two points.


This is different from my (and others') interpretation of your original
question. I suspect that what you want to do is interpolate values of
Y between any two values of X in the list that you provided in your
first posting (see below), thereby providing points along the curve
defined by the table of known X and Y. Right?

That is, given a table of known X and Y, look up an intermediate value
of X (X[k]) to find the largest known X (X[i]) less than or equal to
X[k], then compute the corresponding intermediate value of Y (Y[k])
that lies on the straight line between Y[i] and Y[i+1]. Right?

If that is what you want, perhaps the following will suit your needs.
Let A1:A17 contain known X and B1:B17 contain known Y such that A1:B17
is the table of known values. Let C1 contain X[k], the intermediate
value of X. Then:

C2: =MATCH(C1, A1:B17)

D1: =TREND(OFFSET(B1,C2-1,0):OFFSET(B1,C2,0),
OFFSET(A1,C2-1,0):OFFSET(A1,C2,0), C1)

C2 is the row offset from A1 of the largest X[i] less than or equal to
X[k] in C1. D1 computes the corresponding Y[i]. The expressions
"OFFSET(...):OFFSET(...)" specify the subtables of Y[i+1]:Y[i] and
X[i+1]:X.

You could avoid the use of C2 by replacing C2 with VLOOKUP() everywhere
in the formula in D1.

I suspect there is some easier way to do all this. Now that the
problem is properly specified (if I am right), perhaps someone more
adept with Excel can offer a cleaner solution.


----- first posting -----

Steve J. Vaughan wrote:
Approximating a curve

I have a set of X and Y values for example

X Y
690 0.82
1400 1.72
2075 2.75
2760 3.93
3450 5.31
4150 6.68
4800 8.27
5500 8.34
7600 12.48
11750 8.27
14000 10.68
20000 19.51
24000 25.86
26500 28.89
28500 31.37
32500 33.3
34500 30.3


I need to calculate a value of Y for any value of X.

Is there a F(x) that will allow me to do this.

VLOOKUP is no good as a value of X from 20,001 to 23,999 will give the same
value of Y 19.51