# Formula trend line, KB How can I create a linear trendline in a line chart? :: think-cell

The Trend Function as an Array Formula: If more than one new y-value is to be calculated by the Excel Trend function, the new values will formula trend line returned as an array.

Therefore, the function must be entered as an Array Formula see the examples below. To input an array formula, you need to first highlight the range of cells for the function result.

See the Excel Array Formulas page for further details.

The known x- and y-values are stored in cells A2-B5 of the spreadsheet, and are also shown in the spreadsheet graph. The Excel Trend function formula trend line find the line of best fit for any set of values provided to it.

The Trend function uses the least squares method to find the line of best fit and then uses this to calculate the new y-values for the provided new x-values. This indicates that the function has been input as an Array Formula.

The known x-values are stored in cells A2-C6 and the known y-values are stored in cells D2-D6 of the spreadsheet.

Excel trendline equation is wrong - reasons and fixes Excel trendline types When adding a trendline in Excel, you have 6 different options to choose from.

The set of new x-values is stored in cells A9-C11 and the Excel Trend function, which has been entered into cells D9-D11, is used to find the corresponding new y-values. For further examples of the Excel Trend function, see the Microsoft Office website.