A quick way in excel or MATLAB or C++ is to create a matrix of power of your x axis coordinates and then invert it. For instance, if your data is equally spaced at points x = 0.1, 1.1, 2.1, and 3.1 then you would make a matrix of x to the zero power, first power, second power and finally the third power.
X = 1 0.1 0.1^2 0.1^3
1 1.1 1.1^2 1.1^3
1 2.1 2.1^2 2.1^3
1 3.1 3.1^2 3.1^3
The inver X using excel or inv in MATLAB or 1 / X in the TNT (Template Numerical Toolkit) available for free on the net for C++.
if your data is
y = 5.3 6.3 7.3 8.3
Then you would multiply y as a column vector by inv(x) to get your coefficients.
c = y * X^-1
This is only OK for "good" data with less than 10 points. If you have more points you should use a numerically better solution as suggested by
IRstuff
as in Numerical Recipes
or the TNT library
or the MATLAB backslash or QR functions. You would also want to augment them as explained in the literature.