Formualizer Docs

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

ArgumentTypeRequiredDefault
known_ysnumber (range)Required—
known_xsnumber (range)Optional—
new_xsnumber (range)Optional—
constnumber (range)Optional—

Remarks

  • known_y is required; known_x defaults to 1..n when omitted.
  • new_x defaults to known_x when omitted. With one variable the result has the shape of new_x; with several, new_x holds one observation per row (or per column when known_y is a row).
  • const defaults to TRUE; set to FALSE to 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?.

Implementation

Engine source

On this page