- SpreadJS Overview
- Getting Started
- JavaScript Frameworks
- Best Practices
- Features
- SpreadJS Designer
- SpreadJS Designer Component
- SpreadJS Collaboration Server
- Touch Support
-
Formula Reference
- Formula Overview
-
Formula Functions
- Barcode Functions
- Compatibility Functions
- Database Functions
- Date and Time Functions
- Engineering Functions
- Financial Functions
- Information Functions
- Logical Functions
- Lookup and Reference Functions
- Math and Trigonometric Functions
-
Statistical Functions
- AVEDEV
- AVERAGE
- AVERAGEA
- AVERAGEIF
- AVERAGEIFS
- BETA.DIST
- BETA.INV
- BINOM.DIST
- BINOM.DIST.RANGE
- BINOM.INV
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CHISQ.TEST
- CONFIDENCE.NORM
- CONFIDENCE.T
- CORREL
- COUNT
- COUNTA
- COUNTBLANK
- COUNTIF
- COUNTIFS
- COVARIANCE.P
- COVARIANCE.S
- DEVSQ
- EXPON.DIST
- F.DIST
- F.DIST.RT
- F.INV
- F.INV.RT
- F.TEST
- FINV
- FISHER
- FISHERINV
- FORECAST
- FREQUENCY
- GAMMA
- GAMMA.DIST
- GAMMA.INV
- GAMMALN
- GAMMALN.PRECISE
- GAUSS
- GEOMEAN
- GROUPBY
- GROWTH
- HARMEAN
- HYPGEOM.DIST
- INTERCEPT
- KURT
- LARGE
- LINEST
- LOGEST
- LOGNORM.DIST
- LOGNORM.INV
- MAX
- MAXA
- MAXIFS
- MEDIAN
- MIN
- MINA
- MINIFS
- MODE.MULT
- MODE.SNGL
- NEGBINOM.DIST
- NORM.DIST
- NORM.S.DIST
- NORM.S.INV
- NORMINV
- PEARSON
- PERCENTOF
- PERCENTILE.EXC
- PERCENTILE.INC
- PERCENTRANK.EXC
- PERCENTRANK.INC
- PERMUT
- PERMUTATIONA
- PHI
- PIVOTBY
- POISSON.DIST
- PROB
- QUARTILE.EXC
- QUARTILE.INC
- RANK.AVG
- RANK.EQ
- RSQ
- SKEW
- SKEW.P
- SLOPE
- SMALL
- STANDARDIZE
- STDEV.P
- STDEV.S
- STDEVA
- STDEVPA
- STEYX
- T.DIST
- T.DIST.2T
- T.DIST.RT
- T.INV
- T.INV.2T
- T.TEST
- TREND
- TRIMMEAN
- VAR.P
- VAR.S
- VARA
- VARPA
- WEIBULL.DIST
- Z.TEST
- Sparkline Functions
- Text Functions
- Web Functions
- RegEx Functions
- Other Functions
- Import and Export Reference
- Frequently Used Events
- API Documentation
- Release Notes
TREND
This function returns values along with a linear trend. This function fits a straight line to the arrays known as x and y values. Trend returns the y values along that line for the array of specified new x values.
Syntax
TREND(y, x, newx, constant)
Arguments
This function has these arguments:
Argument | Description |
|---|---|
y | Set of y values that are known in the relationship y=mx+b |
x | (Optional) X is an optional set of x values that may be known in the relationship y=mx+b |
newx | New x values for which this function returns the corresponding y values |
constant | Logical value that specifies whether to force the constant b to equal 0 |
Remarks
If constant is true or omitted then b is calculated normally. If constant is false then b is equal to 0 and the m values are adjusted so that y=mx.
If x is omitted then x defaults to the array {1,2,3...}, that has the same dimensions as y.
If newx is omitted then it defaults to x.
Use the INDEX function to get individual elements from the returned array.
Data Types
Accepts an array. Returns an array.
Examples
TREND(A2:A7,C2:C7,A9:A10)