Recreating Weighted linear regression

Hello,

I am using the curve fitting algorithm (line) to fit (x,y) points of data.  I have estimated uncertainty associated with the Y wave that I put into a "weight wave" and the weight wave is 0.01*ydata (ie, 1% uncertainty).  I curve fit the ydata vs xdata and include this weighting wave in the dialog and I get a fit that I like.  

My issue is that I would like to recreate this fit without the weighting option so that I can do it in other code environments, or in Excel.  All my linear regression texts say that I should multiply the ydata and xdata by some function of the weight (either weight itself, sqrt(weight), (weight)^2 etc depending on how weight is defined) to get a new set of x and y that will yield the same fitting parameters.  However every combination that I try doesn't work.

For reference.

http://www.real-statistics.com/multiple-regression/weighted-linear-regr…

Dataset (17.71 KB)

I figured it out.  Not only do I have to multiply xdata by 1/(weight^2) but also the column of "ones" in the X-matrix.  Thanks!

Your link takes us to a description of weighted fitting. If Excel doesn't have a way to do weighted fitting, that proves that you should not be using Excel.