Category: FUNCTION | Updated: 2026-11-22
How to Use the STEYX Function in Google Sheets | Calculate the Standard Error of a Regression Line
STEYX Function
The STEYX function returns the standard error of the predicted y-value for each x in a linear regression, given datasets of known y (dependent variable) and x (independent variable).
Syntax
=STEYX(data_y, data_x)
- data_y: Specifies the data array or cell range for the dependent variable (target variable).
- data_x: Specifies the data array or cell range for the independent variable (explanatory variable).
Practical Table Example
This example calculates the standard error of the regression line from ad spend (x) and sales (y) data.
| Cell | A (Ad Spend: 10k JPY) | B (Sales: 10k JPY) |
|---|---|---|
| 1 | Ad Spend (x) | Sales (y) |
| 2 | 10 | 120 |
| 3 | 20 | 210 |
| 4 | 30 | 290 |
| 5 | 40 | 420 |
| 6 | 50 | 500 |
Formula:
=STEYX(B2:B6, A2:A6)
Result:
11.83215957 (the standard error of the sales forecast is approximately 118,300 JPY / 11.83 ten-thousand JPY)
Common Errors and Precautions
- Watch the argument order: Specify
data_yas the first argument anddata_xas the second argument. Be careful, as this is the reverse of the usual “x, y” order. #N/Aerror: Occurs when the number of data points (cells) indata_yanddata_xdoes not match.#DIV/0!error: Occurs when there are 2 or fewer valid numeric data pairs, or when all values indata_xare identical so the slope cannot be calculated.- Handling of text and blanks: If the range contains text, logical values, or blank cells, those pairs are ignored in the calculation.
Frequently Asked Questions
Q. What is the STEYX function used to check?
A. It is used to check the accuracy (dispersion) of predictions made by a regression line. A smaller value indicates that data points are closer to the regression line and prediction accuracy is higher.
Q. What causes a #DIV/0! error in the STEYX function?
A. A #DIV/0! error occurs when there are fewer than 3 data points, or when all known x values are identical so the variance is 0.