Excel LINEST Function

LINEST([CELLS] Y Values, [CELLS] X Values, [BOOL] Constant, [BOOL] Stats)

Follow this procedure to use LINEST to compute the slope and intercept of the best-fit line for your data, along with the uncertainties for both values:

  1. Start with your X data values in one column and your Y data values in another column.
  2. Select four cells:
  3. Click on the formula bar and type this:
    (But instead of A1:A20, use the range of cells containing your Y values,
    and instead of B1:B20, use the range of cells containing your X values.)
  4. Press Ctrl+Shift+Enter
  5. Each cell will now contain this information:

Here is an animated GIF showing how to perform these steps: