TREND
Returns fitted y-values along a linear trend derived from known data.
TREND fits the same least-squares model as LINEST and returns predictions for new_x
(or defaults).
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=TREND(known_ys, [known_xs], [new_xs], [const])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
known_ys | number (range) | Required | — |
known_xs | number (range) | Optional | — |
new_xs | number (range) | Optional | — |
const | number (range) | Optional | — |
Remarks
known_yis required;known_xdefaults to1..nwhen omitted.new_xdefaults toknown_xwhen omitted. With one variable the result has the shape ofnew_x; with several,new_xholds one observation per row (or per column whenknown_yis a row).constdefaults toTRUE; set toFALSEto force a zero intercept.
Error cases
- Returns
#VALUE!for non-numeric data and#REF!for incompatible shapes.
Examples
Fit the observed series with default x values.
Formula =TREND({2;4;8})
Expected result {1.66666666666667; 4.66666666666667; 7.66666666666667}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Predict two new observations with explicitly supplied x values.
Formula =TREND({2;4;8},{1;2;3},{4;5},TRUE)
Expected result {10.6666666666667; 13.6666666666667}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Predict at the first of two known x values.
Formula =TREND({2;4},{1;2},{1})
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The known x and y arrays must have corresponding observations.
Formula =TREND({2;4;8},{1;2},{4})
Expected result #REF!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Predict two future points on a line
Formula =TREND({2,4,6},{1,2,3},{4,5})
Expected result {8, 10}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Default x-values with fitted trend
Formula =TREND({3,5,7})
Expected result {3, 5, 7}
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.