
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. ActiveWorkbook.Charts("Chart1").SeriesCollection(1).Trendlines.Add This example creates a new linear trendline on Chart1. If this argument is omitted, Microsoft Excel generates a name.Ī Trendline object that represents the new trendline. True to display the R-squared value of the trendline on the chart (in the same data label as the equation). True to display the equation of the trendline on the chart (in the same data label as the R-squared value). If this argument is omitted, the intercept is automatically set by the regression. The number of periods (or units on a scatter chart) that the trendline extends backward. The number of periods (or units on a scatter chart) that the trendline extends forward. Must be an integer greater than 1 and less than the number of data points in the series you are adding a trendline to. Must be an integer from 2 to 6, inclusive. Add ( Type, Order, Period, Forward, Backward, Intercept, DisplayEquation, DisplayRSquared, Name)Įxpression A variable that represents a Trendlines object.


Thank you for this opportunity to explore the FORECAST function. If I were Tim Cook looking at Apple sales, I would not pay much attention to this forecast 👿. On the Review tab, click Unprotect Sheet or. If you still can't see the formula for cells, try unprotecting the sheet or the whole workbook. This setting applies only to the sheet that you are currently viewing. Under Show in Workbook, select the Formulas check box. The green data points are a linear projection (forecast) of the data, not a projection of the connection line. To do that: On the Excel menu, click Preferences.

In the table, add more rows to contain Y forecast and enter the new X values.Ĭlick on the graph to select it and Edit Data Referencesĭrag the white circle (Fill Handle) down and right to include all three columns and all rows Show Equation (if you like, for clarity). Select Columns A and B and insert a Scatter Plot.įormat Panel > Series > Connection Line > Curved (for clarity this has nothing to do with the FORECAST function).Ĭlick on the Series within the graph to select it and Format Panel > Series > Trendline > Linear ( this is what FORECAST will use to project, but it is not necessary only shown for clarity). This table has one Header Row and no Header Columns. Now, why did you create another 2 columns (Prediction Table)? Now you lost me: Why not stick with 3 columns (3rd being Forecast)?
