polynomial regression

D

Duane Kibby

Help,

linestResults() = Application.WorksheetFunction. _
LinEst(y, x^{1,2},true, True)

When trying to use this form of the "Linest" function, I
get a "Invalid Character" error at the "{" character.
Nothing seems to work.

Thanks in advance,
Duane
 
D

David J. Braden

Duane,
AFAIK, you cannot call the wks functions from VBA with the same syntax
you use in the worksheets when it comes to array-entered functions.
Alternatives:
Set up a veryhidden worksheet with X, enter the LINEST formula into
another cell, do the calc, grab the result.

Hmmm, others come to minf, but they might be flakier.

HTH

Dave Braden
 
J

Jerry W. Lewis

VBA doesn't do array entry of worksheet functions. If x and y are
ranges, you could use

Evaluate("LinEst(" & y.Address & "," & x.Address & "^{1,2},true, True)")

Jerry
 

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