title: How do I get the polynomial regression coefficients using Excel VBA?
body: <p>I have two columns, say <code>x</code> and <code>f(x)</code>. I want to get the coefficients of the second degree equation after doing the polynomial regression in Excel VBA.</p>
  
  <p>I'm a rookie in Excel VBA and have no clue what to do.</p>
  
  <p>For example-</p>
  
  <blockquote>
    <p>x y<br>
    -1 -1<br>
    0 3<br>
    1 2.5<br>
    2 5<br>
    3 4<br>
    5 2<br>
    7 5<br>
    9 4  </p>
  </blockquote>
  
  <p>The coefficients for the equation <code>f(x)=a*x^2+b*x+c</code> will be </p>
  
  <pre><code>a= -.008571
  b= 0.99555
  c= 1.648439. 
  </code></pre>
  
  <p>I got the coefficients using <a href="http://www.arachnoid.com/polysolve/" rel="nofollow">THIS</a> website</p>