Access to Chart Trendline Equations in VB

G

Guest

I would like to get the 3rd order polynomial coefficients for an X-Y Chart
trendline into VB so I can automatically run a calculation at a extrapolated
X value and record this in my spreadsheet. If I can not get the coefficients
directly to do the calculation myself, can I plug in the X value and
calculate the resultant would help.
 
J

Jon Peltier

If you just want the coefficients, you can use LINEST. Select a range 4
cells wide and five cells high. Type this equation:

=LINEST(<yRange>,<xRange>^{1,2,3},TRUE,TRUE)

where xRange and yRange are the addresses of the X and Y values, and
array-enter the formula by holding CTRL+SHIFT while pressing ENTER. The
first row of cells show the 3rd, 2nd, 1st, and 0th order coefficients of the
poly fit. Check help for LINEST to learn what the rest of the LINEST output
includes.

- Jon
 

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