STEYX Function
Returns the standard error of the predicted y values in a straight-line fit.
Category
Statistical
Available in
All versions, Microsoft 365
Returns
A number
Overview
STEYX measures how far the points typically sit from the best-fit line, in y's units. Small means the line predicts well; large means the points are scattered.
It's calculated as √(sum of squared residuals ÷ (n − 2)), and is often used to put a rough ± range around a prediction.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| known_y's | Yes | The values you want to predict (for example, sales). |
| known_x's | Yes | The values that drive them (for example, ad spend), the same size as known_y's. |
Examples
Example 1 — How far off is the trend line?
Sales predicted from ad spend.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Ad spend ($k) | Sales ($k) | Measure | Result |
| 2 | Jan | 2 | 21 | Std error | 1.0938 |
| 3 | Feb | 3 | 25 | Forecast @10 | 53.29 |
| 4 | Mar | 5 | 33 | + 2 errors | 55.47 |
| 5 | Apr | 4 | 28 | ||
| 6 | May | 6 | 38 | ||
| 7 | Jun | 7 | 40 | ||
| 8 | Jul | 8 | 46 | ||
| 9 | Aug | 5 | 31 |
Actual sales typically land within about ±$1.1k of the line. Two standard errors give a rough upper bound for a $10k month.
Common mistakes
- #DIV/0! Fewer than three pairs of numbers, or all the x values are the same.
- #N/A The ranges are different sizes.
- A rough guide only. STEYX ignores the extra uncertainty of predicting far outside your x values.
Notes
- LINEST with stats = TRUE returns the same figure (third row, second column).
- Related functions: RSQ, SLOPE, LINEST, FORECAST.LINEAR.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.