Install free

Guides

How to run a regression in Google Sheets

A regression estimates how much an outcome changes when each input changes. This guide uses a small marketing dataset: monthly sales, ad spend and price for 15 months.

ABC
1Ad spendPriceSales
2128.237.8
3159.645.2
497.439.8
5229.166
61810.352.5
7257.988.3
8309.490.5
9148.847.4
10207.177.2
11271079.7
12338.5108.6
13119.927.5
14247.681.5
15298.995.5
161710.445

Run it with the Regression tool

  1. Open Extensions, StatPak, Data Analysis and choose Regression.
  2. Input Y range: the Sales column including its header, C1:C16.
  3. Input X range: Ad spend and Price together, A1:B16. X columns must sit next to each other.
  4. Tick Labels in first row so the output uses your column names.
  5. Click Run.

You get the same summary that Excel produces:

SUMMARY OUTPUT
Regression Statistics
Multiple R0.9947242
R Square0.9894762
Adjusted R Square0.9877223
Standard Error2.761873
Observations15
ANOVA
dfSSMSFSignificance F
Regression28606.4254303.212564.1381.3584E-12
Residual1291.535317.627942
Total148697.96
CoefficientsStandard Errort StatP-valueLower 95%Upper 95%Lower 95.0%Upper 95.0%
Intercept54.049076.4709218.3526092.4111E-639.9501468.14839.9501468.148
Ad spend3.207810.0987919232.470374.6043E-132.9925613.4230592.9925613.423059
Price-6.0843410.6898521-8.8197771.3663E-6-7.5874-4.581283-7.5874-4.581283

How to read the output

The same numbers with LINEST

For a quick check without an add-on, enter this in an empty cell:

=LINEST(C2:C16, A2:B16, TRUE, TRUE)

LINEST returns coefficients in reverse order (last X column first, intercept last) and puts standard errors in the second row and R squared in the third. It does not give p-values or confidence intervals; compute those with =T.DIST.2T(ABS(coef/se), df) and =T.INV.2T(0.05, df).

Simple regression with one input

With only ad spend as the input, R Square is 0.9212573 and the slope is 3.201894. In Sheets you can also get these with =SLOPE(C2:C16, A2:A16), =INTERCEPT(C2:C16, A2:A16) and =RSQ(C2:C16, A2:A16).

Common errors

Related guides