# TREND Function

> Calculate values along a least squares linear trend with TREND in TX Sheet Control: known y and x values, new x values, the const argument and #REF! errors.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > TREND Function
- **240 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/trend/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/trend/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/trend/llms-full.txt

---

Return values along a linear trend fitted to known data by the least squares method. `known_y` are the known y-values and `known_x` the matching x-values; `new_x` are the x-values to calculate y-values for. Without `new_x`, TREND returns the fitted values of `known_x`. When `const` is FALSE, the line is forced through the origin; the default TRUE calculates the intercept. Arrays of different sizes return `#REF!`.

### Syntax

```text
TREND(known_y, known_x, new_x, const)
```

Category: Statistics. Minimum arguments: 1. Maximum arguments: 4.

Available for supported offline calculation.

### Examples

```text
=TREND({2;4;6},{1;2;3},{4;5})
```

The formula returns a column with 8 and 10, the continuation of the line y = 2x for x = 4 and 5.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [TRANSPOSE Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/transpose/llms-full.txt)
- **Next:** [TRIM Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/trim/llms-full.txt)
