Formula to calculate missing data points

hstaubyn

Board Regular
Joined
Sep 13, 2010
Messages
93
Hi,

I have a table of data, but it has gaps in it. I know all the 'x' values (they go from 1 to 69 linearly), but some of the 'y' values are missing.

I know the 'y' values vary cyclically so would have thought that excel would have a formula that looks at the whol table, effectively draws a line graph in its head and then fills in the missing data points with values based on said line graph.

e.g.

x: 1----2----3----4----5----6----7----8----9----10
y: 23--18---21---:warning:---28---37---25---17---:warning:----23

I want to put formulae in the cells corresponding to x values of 4 and 9 and have the formula calculate the value based on the other values on the same row.

I have tried placing the following in cells P9, U9 & AG9 (does not correspon to columns above):

HTML:
=TREND((O9,Q9:T9,V9:AF9,AH9:AR9),O7:AR7)

this does not work! Trend cannot read multiple ranges for "known 'y's". Does anyone know of a formula that does? Or failing that, a UDF somewhere that does this?

Thanks,

H
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Code:
      A- B- C- -D-- E- F- G- H- I- J-
  1    1  2  3    4  5  6  7  8  9 10
  2   23 18 21 24.5 28 37 25 17 20 23

The formula in D2 could be

=TREND(CHOOSE({1,2}, C2,E2), CHOOSE({1,2}, C1,E1), D1)

or

=(D1-C1)/(E1-C1) * (E2-C2) + C2
 
Upvote 0
Ok thanks for that, I'm going to have to get my head round the first one...

I guess you're going for a kind of moving average formula which is great, except that it doesn't take account of multiple adjacent empty cells. (I know I didn't mention this in my post.)

Trend line when applied to a graph does work even with adjacent empty values. Now if this is so why isn't there a formula to return 'y' values from a trend line derived approach?

Seems daft to me that you can produce a visual line (trend line on a graph) which has to have numerical data behind it, but you can't access that numerical data.

Or am I missing something???
 
Upvote 0
You can return the coefficients of a trendline using LINEST.

However, there's a difference between a linear interpolation of adjacent points and a (linear) trendline, which is a best fit of a straight line to a set of points. Which are you trying to do?
 
Upvote 0
Shg,

thanks for your reply. I am happy with the LINEST function, but as you say, it only approximates a straight line. I am after a formula that gives the powers, coefficients etc. used by the trendline on a graph.

Surely it must be possible to have a formula that gives these values and for all the different types of trendline (Linear, Logarithmic, Polynomial - with choice of order, Power, Moving Average - with choice of period). It would be possible to create these formulae from scratch, but I was wondering if

a. Microsoft had thought of this and included the necessaries
b. If not, then someone knew where to find a UDF that does this

Cheers,

H
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top