FormulaCraft

TREND

TREND fits a straight line to known data pairs via least squares and returns predicted y-values for one or more new x-values. It is an array function ideal for generating a series of forecasts or plotting a best-fit trendline across many points simultaneously.

Excel
=TREND(B2:B5,A2:A5,{5;6;7})
Google Sheets
=TREND(B2:B5,A2:A5,{5;6;7})

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1Arrange your historical y-values and x-values in separate columns.
  2. 2Decide the new x-values for which forecasts are needed — enter them as an array or range.
  3. 3Enter =TREND(known_ys, known_xs, new_xs) as an array formula (Ctrl+Shift+Enter in older Excel) to return all predicted values at once.

Need a version for your data?

Try: “Project sales for months 5, 6, and 7 based on the past four months of data

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: