
Image by Editor
Predictive modeling may seem like something you can only do with programming tools like R or Python. But Google Sheets offers powerful built-in statistical functions, and you can create surprisingly capable regression models right inside your browser. These functions bridge the gap between spreadsheet analysis and data science without writing any code. In this tutorial, we show how to build a predictive model in Google Sheets using the LINEST and LOGEST functions.
Let’s consider the monthly sales growth of a small business. We have recorded monthly advertising spend and resulting revenue over the past 10 months.
The goal is to predict future revenue based on future ad spending.
Building a Linear Predictive Model With LINEST
Syntax:
=LINEST(known_y, known_x, [const], [stats])
- known_y: Your dependent variable (what you’re predicting)
- known_x: Your independent variable(s)
- const: TRUE to calculate the intercept normally, FALSE to force the fit through zero
- stats: TRUE to return additional regression statistics
Step 1: Using the LINEST Function
In Google Sheets, enter the following formula in an empty cell.
=LINEST(C2:C11, B2:B11, TRUE, TRUE)
The first range, C2:C11, represents the dependent variable (Revenue), while B2:B11 is the independent variable (Ad Spend). The two TRUE arguments tell Google Sheets to calculate both the intercept and regression statistics.

Google Sheets returns an array of results. The top-left value is your slope (m), and the next cell to the right is your intercept (b). The second row provides standard errors, and the rightmost columns give regression metrics such as R², which measures how well the model fits your data.
Step 2: Creating Predictions
Now you can use these coefficients to create predictions for Ad Spend. Insert any ad spend amount, and this formula will return the revenue.
Revenue = (slope * Ad Spend) + intercept
Let’s use the model for prediction. Select a cell and enter the following formula.
=(F1*1700)+G1
Here, F1 is the slope and G1 is the intercept, and the ad spend is \$1,700. This formula returns the expected revenue for that spend level. This simple linear model predicts revenue of about \$115807.45.

Step 3: Visualizing the Linear Fit
Visualization makes it much easier to see how well your model tracks actual data.
To visualize your model,
- Highlight both the Ad Spend and Revenue columns
- Go to the Insert menu → select Chart

- Select Chart Editor → select Scatter Chart from Chart type
- Go to the Customize tab → select Series → select Trendline → set it to Linear → select Show R²

This confirms that your line closely follows the data points. A higher R² means better predictive accuracy.

Building an Exponential Model With LOGEST
The LOGEST function calculates an exponential regression for data that grows or decays exponentially, using the equation y = b * m^x. This is particularly useful for data that shows accelerating growth rather than steady linear growth.
Syntax:
=LOGEST(known_y, known_x, [const], [stats])
- Same parameters as LINEST, but fits an exponential curve
Sometimes, relationships grow exponentially, like viral marketing or compound interest. In such cases, a linear model may underestimate future growth. The LOGEST function models data that follows an exponential trend of the form above.
Step 1: Using the LOGEST Function
In a new area of your spreadsheet or a new worksheet, you can create the exponential (nonlinear) predictive model. Select a cell and insert the following formula.
=LOGEST(C2:C11, B2:B11, TRUE, TRUE)
This formula returns a similar structure to LINEST but represents different parameters. The first row shows the base (m) in the first column and the coefficient (b) in the second. Together, these define the exponential curve. The remaining rows provide standard errors, R², F statistic, and sums of squares, just as LINEST does.

Step 2: Creating Exponential Predictions
You can now use the outputs in your predictive formula.
Revenue = coefficient * base ^ (Ad Spend)
Select a cell and enter the following formula.
=L1*K1^12000
Here, L1 is your coefficient (b), K1 is your base (m), and $12,000 is the ad spend. This formula returns the revenue implied by the exponential model.

The exponential model captures accelerating trends more effectively than LINEST, though it may overfit small datasets if the pattern isn’t truly exponential.
Calculating Residuals
No predictive model is complete without checking how well it performs. Residuals are the differences between the actual and predicted values. They reveal whether the model consistently over- or underestimates outcomes.
In column D, enter the following formula in D2.
=($F$1*B2)+$G$1
Then drag it down for all rows (D2:D11). This gives the Predicted Revenue for each Ad Spend.
Linear Residuals:
In E2, insert the following formula.
=C2-D2
Then drag it down for all rows. This gives the residual, which is the difference between actual revenue and predicted revenue.

Residuals close to zero indicate good predictions. Systematic patterns in residuals suggest your model isn’t capturing important aspects of the data relationship. These residuals show a systematic curvature, meaning the relationship between Ad Spend and Revenue grows faster than linear. It’s a sign that your linear model may be oversimplifying reality.
Comparing Both Models
R² appears in the third row of the expanded LINEST or LOGEST output (first column of that row). This statistic measures how much of the variance in your dependent variable is explained by your model. Values closer to 1.0 indicate a better fit. Compare the two models’ R² values to see which explains more variance.
The sums of squares and related diagnostics also help:
- Standard error of y estimate appears in the third row, second column
- F statistic and degrees of freedom appear in the fourth row (first and second columns, respectively)
- Regression sum of squares and Residual sum of squares appear in the fifth row (first and second columns)
Lower residual sum of squares indicates better performance by quantifying the absolute magnitude of prediction errors, complementing R².
Making Predictions and Decisions
Once your model performs reasonably well, you can use it to estimate future outcomes. For example, if you plan to spend $8,000 on ads next month, your LINEST model’s slope and intercept can forecast the corresponding revenue. Similarly, LOGEST can help you model long-term growth when the effect of ad spending compounds over time.
While this may seem simple, these functions do the same kind of work that regression algorithms in R, Python, or Excel’s Analysis ToolPak do: estimating best-fit parameters, error statistics, and trend behavior. The difference is accessibility — anyone with a Google account can build and test predictive models right in Sheets.
Conclusion
By following the above steps, you can build a predictive model in Google Sheets using the LINEST and LOGEST functions. Mastering LINEST and LOGEST is a solid step from spreadsheet analytics into true predictive modeling. These formulas teach you to think in terms of dependent and independent variables, statistical fit, and model diagnostics — the same foundations used in professional data science. Google Sheets might not handle massive datasets or automate model selection, but it’s an excellent environment for exploring how predictive reasoning works, one formula at a time.
