View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rick is offline
external usenet poster
 
Posts: 334
Default Selecting data in tables, if not given then interpolating

I have a similar problem where I want to interpolate values between entries
on a table.

Have been looking through many help sites like this one and have concluded
that Excel can't interpolate.

I tried Excel's FORECAST() formula but this only seems to work if the values
in the table would make a straight line on a graph.

Option 1
It's theoretically possible to derive a mathematical equation from the data.
Try running Excel's chart wizard on your table to see if it produces a nice
graph.
If it's a continuous straight line, then you will be able to obtain a
formula for the graph.
Don't know how good your mathematics is, but if you don't know how to obtain
the formula, there are plenty of help sites on the internet.
Example of a mathematical formula for a straight line; y = 4x €“ 2
If your graph is a smooth continuous curve, it still may be possible to
derive an equation, you would end up with an equation something like; y =
4x^2 -2
Then you can just use Excel to plug in the number you already have and
obtain the exact equivalent value for the next row on your table

Option 2
If your graph is not straight, or is unusually shaped or irregular in some
other way, then probably it doesn't conform to an equation at all.
(or the equation is simply too complex for normal people to comprehend!)

Many industries (eg engineering, aviation, etc.) use tables like these, so I
will assume that (just like me) you have something like this.

The only way I found to do it was to instruct Excel to do exactly what I
would do if I was manually interpolating the tables.
I will copy below the way I processed your data to make Excel obtain the
same result of a=1.11 when R=0.15, just like you indicated in your posting.


CELL a B C D E
1 R 0 0.1 0.2 0.3
2 a 1 1.07 1.15 1.23
3 b 1 0.93 0.89 0.75

CELL A B C
5 Formula Value
Description
6 n/a 0.15
actual R
7 =HLOOKUP(B6,B1:E3,1,TRUE) 0.1 lower R
8 =B7+0.1 0.2 upper R
(assuming R in the table always increases by same amount, ie 0.1)
9 =B8-B7 0.1
difference 'R'
10 =B6-B7 0.05
difference 'actual R'
11 =HLOOKUP(B7,B1:E3,2,TRUE) 1.07 lower a
12 =HLOOKUP(B8,B1:E3,2,TRUE) 1.15 upper a
13 =B12-B11 0.08
difference 'a'
14 =B13/B9 0.8 variation
15 =B14*B10 0.04 variation x
difference
16 =B15+B11 1.11 actual
value for a


To get the values for b, c, etc. you should repeat once again the column of
formulas, and change the relevant cell values in order to interpolate the
next row.
I know it looks clunky and takes up loads of space on your spreadsheet, but
it's the only way I have found (so far!) for Excel to interpolate data.

For my tables, I copied the table on one worksheet, kept the calculations on
a seperate worksheet, and had a third worksheet which used the results
obtained. It's easy enough to cross-reference the sheets and it keeps the
calculations hidden away out of sight.

Hope this was a help.