Statistical function

STEYX function

Returns the standard error of the predicted y-values in a linear regression: the typical size of the prediction error.

Available in All versions of Excel, including Microsoft 365 and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

STEYX(known_y's, known_x's)
ArgumentWhat it means
known_y'sRequiredThe dependent values.
known_x'sRequiredThe independent values, same number of points.

Returns: The standard error of the estimate, in the units of y.

How STEYX works

After fitting a straight line with SLOPE and INTERCEPT, the next question is "how far off are the predictions, typically?". STEYX answers it. It measures the scatter of the actual points around the regression line, in the same units as y. If STEYX is 0.87 (thousand euros), predictions from the line are usually within about one thousand euros of reality.

The calculation squares the vertical distances from each point to the line, adds them up, divides by n − 2 (two parameters were estimated) and takes the square root. It is the same number as row 3, column 2 of LINEST with statistics. A rough 95% band for an individual prediction is the predicted value ± 2 × STEYX (slightly wider far from the middle of the data).

Examples

1Typical prediction error for sales

D2fx=STEYX(B2:B6, A2:A6)
ABCD
1Ad spend (k)Sales (k)
22410.8746
3452
4558
5770
6979

Result: 0.8746

0.874551 (shown to 4 decimals): sales predictions from ad spend are typically off by under 1k.

2Error band for delivery-cost model

D2fx=STEYX(B2:B6, A2:A6)
ABCD
1KmCost
210283.81
32552
44081
55598
670131

Result: 3.81

3.812261 (shown to 2 decimals). A quote of predicted cost ± 2 × this value would cover most real costs.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe ranges have different numbers of points.Use ranges of equal size.
#DIV/0!Fewer than three data points.STEYX needs at least three points (n − 2 > 0).

Tips

  • Compare STEYX with the average of y to judge whether the error is small in context.
  • For forecast intervals at a specific x, Excel's FORECAST.ETS.CONFINT works for time series; for regression build the interval from STEYX and T.INV.2T.

Google Sheets

STEYX also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

STEYX in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishSTFYX
DutchSTAND.FOUT.YX
FinnishKESKIVIRHE
FrenchERREUR.TYPE.XY
GermanSTFEHLERYX
HungarianSTHIBAYX
ItalianERR.STD.YX
Norwegian (Bokmål)STANDARDFEIL
PolishREGBŁSTD
Portuguese (Brazil)EPADYX
Portuguese (Portugal)EPADYX
RussianСТОШYX
SpanishERROR.TIPICO.XY
SwedishSTDFELYX
TurkishSTHYX