Sunteți pe pagina 1din 24

Forecasting in Excel

Mary Gretsnally Pusod and Thu Nguyen


08 January 2020
Forecasting in Excel

FORECAS is about predicting the future as accurately as possible, given all of the information available,
TING including historical data and knowledge of any future events that might impact the forecasts.

SHORT- are needed for scheduling of personnel, production and transportation. As part of the
TERM scheduling process, forecasts of demand are often also required.

MEDIUM- are needed to determine future resource requirements, in order to purchase raw materials,
TERM hire personnel, or buy machinery and equipment.

LONG- are used in strategic planning, such decisions must take account market opportunities,
TERM environmental factors and internal resources.

Athanasopoulos, R. J. (August 2014). Forecasting : Principles and Practice. OTEXTS.COM.


Forecasting Methods

REGRESSION ANALYSIS USING LINEAR FORECASTING


ANALYSIS TOOLPAK ADD-ON FUNCTION

EXPONENTIAL SMOOTHING FORECASTING ARITHMETICAL AVERAGE


IN EXCEL

MOVING AVERAGE &


NAÏVE FORECAST
WEIGHTED MOVING AVERAGE
Regression Analysis in Excel

y = b x + a +
Dependent Slope of a Independent Y-intercept, Random error,
variable regression line, variable it's the point which is the difference
which is rate where the between the actual
of change for line crosses value of a dependent
y as x changes variable and its
the Y axis
predicted value

y
Least Squares Method in Excel where:

Dependent variable (y) = b * Independent variable (x) + a


Umbrellas Sold = b * rainfall + a
x
Regression Analysis in Excel

SOLVE EXERCISE NO.1


1) Open the Excel Application.
2) Enable the Analysis ToolPak add-on. (File – Options – Add-ins – Click Go – Analysis ToolPak)

RUN REGRESSION ANALYSIS IN EXCEL WITH ANALYSIS TOOLPAK


1) Select the Data menu. Then, in the Analysis group, select Data Analysis.
2) In the Data Analysis window, select Regression from the list and click OK.
3) Select the Input Y Range, which is your dependent variable. In our case, it's umbrella sales (C4:C28).
4) Select the Input X Range, i.e. your independent variable. In this example, it's the average monthly rainfall
(B4:B28).
5) Check the Labels box if there are headers at the top of your X and Y ranges.
6) Choose your preferred Output option, a new worksheet in our case.
7) Optionally, select the Residuals checkbox to get the difference between the predicted and actual values.
Regression Analysis in Excel Interpretation of the Results

Correlation Coefficient An absolute measure that


that measures the strength shows the average distance
of a linear relationship that the data points fall
between two variables, any from the regression line.
value between -1 and 1, and If this error is small then
its absolute value indicates your regression results are
the relationship strength. more accurate.

Coefficient of Determination,
which is used as an
indicator of the goodness
of fit. Generally, R- Squared
of 95% or more is R square adjusted for the The number of
considered a good fit. number of independent variable observations in your
in the model. You will want to use regression model.
this value instead of R square for
multiple regression analysis.
Regression Analysis in Excel Interpretation of the Results

Build a LINEAR REGRESSION EQUATION: y = bx + a


Where, y is the number of umbrellas sold and x is an average monthly rainfall, our linear regression
formula goes as follows:

Y = Rainfall Coefficient * x + Intercept

Equipped with a and b values rounded to three decimal places, it turns into:

Y= 0.45*82 -19.074

*X= 82mm
Regression Analysis in Excel Interpretation of the Results

Why's the difference? Because independent variables are


never perfect predictors of the dependent variables.

For the first data point (rainfall of 82 mm), the residual is


approximately -2.8. So, we deduct this number to the
predicted value, and get the actual value: 17.8 - 2.8 = 15.

(rainfall of 99.6 mm), the residual is approximately


+4.25. So, we add this number to the predicted value,
and get the actual value: 25.75 + 4.25 = 30.
Regression Analysis in Excel Creating Graph in Excel

1) Highlight/Select the two columns with your data,


including headers.
2) On the Insert tab, click the Recommended
chart icon, or select the Scatter chart icon.
3) On the chart, draw the least squares regression
line. To have it done, right click on any point and
choose Add Trendline from the context menu.
4) On the right pane, select the Linear trendline
shape and, optionally, check Display Equation on
Chart to get your regression formula:
5) Switch to the Fill & Line tab and customize the
line to your liking. For example, you can choose a
different line color and use a solid line instead of
a dashed line (select Solid line in the Dash
type box): > Solve Exercise No.2 in Excel
Regression Analysis in Excel Regression Using Formulas

If you avoid using array formulas in your worksheets, you can


LINEST calculate a and b individually with regular formulas:
FUNCTION

uses the least squares SLOPE INTERCEPT CORREL


regression method to FUNCTION FUNCTION FUNCTION
calculate a straight line
that best explains the b (slope of a a (y-intercept) Correlation
relationship between your
regression line) =INTERCEPT(C2:C25, Coefficient
variables and returns an B2:B25)
=SLOPE(C2:C25, B2:B25) =CORREL(B2:B25,C2:C25)
array describing that line. =0.450001 =19.0741 =0.957667

=LINEST(C2:C25,B2:B25)

y = bx + a
Excel FORECAST and other Exponential Smoothing
forecasting functions Solve Exercise No.04

1. Highlight the actual data.


2. On the Data tab, in the Analysis group, click Data Analysis.
3. Select Exponential Smoothing and click OK.
4. Click in the Input Range box and select the range.
5. Click in the Damping factor box and type 0.1. Literature often talks about the smoothing constant α (alpha).
The value (1- α) is called the damping factor.
6. Click in the Output Range box and select cell.
8. Plot a graph of these values.

Conclusion: The smaller alpha (larger the damping


factor), the more the peaks and valleys are
smoothed out. The larger alpha (smaller the
damping factor), the closer the smoothed values are
to the actual data points.
Excel FORECAST and other forecasting functions

In the recent versions of Excel, there exist six different forecasting functions.
The two functions do linear forecasts:
1) FORECAST - predicts future values by using linear regression; a legacy function for backwards
compatibility with Excel 2013 and earlier.
2) LINEAR - identical to the FORECAST function; part of the new suite of forecasting functions in Excel
2016 and Excel 2019.

The four ETS functions are purposed for exponential smoothing forecasts. These functions are only
available in Excel for Office 365, Excel 2019, and Excel 2016.
✓ ETS - predicts future values based on the exponential smoothing algorithm.
✓ ETS.CONFINT - calculates the confidence interval.
✓ ETS.SEASONALITY - calculates the length of a seasonal or other recurring pattern.
✓ ETS.STAT - returns statistical values for time series forecasting.
Excel FORECAST and other Excel Forecast Function
forecasting functions Solve Exercise No.03

Where:
▪ X (required) - a numerical x-value for which you want to predict a new y-value.
▪ Known_y's (required) - an array of known dependent y-values.
▪ Known_x's (required) - an array of known independent x-values.

Both functions calculate a future y-value by using the linear regression equation: y = bx + a
Where the a constant (intercept) is:

And the b coefficient (slope of the line) is:


Excel FORECAST and other Exponential Smoothing
forecasting functions Solve Exercise No.04

The FORECAST.ETS function is used to do exponential smoothing forecasts based on a series of existing
values. Predicts a future value based on the AAA version of the Exponential Triple Smoothing (ETS) algorithm.

Where:
▪ Target date (required) - the data point for which to forecast a value (date/time or number).
▪ Values (required) - a range or array of historical data for which you want to predict future values.
▪ Timeline (required) - an array of dates/times or independent numeric data with a constant step between them.
▪ Seasonality (optional) - a number representing the length of the seasonal pattern:
• 1 or omitted (default) - Excel detects seasonality automatically by using positive, whole numbers.
▪ Data completion (optional) - accounts for missing points.
• 1 or omitted (default) - fill in the missing points as the average of the neighboring points (liner interpolation).
▪ Aggregation (optional) - specifies how to aggregate multiple data values with the same time stamp.
• 1 or omitted (default) - the AVERAGE function is used for aggregation.
• Your other options are: 2 - COUNT, 3 - COUNTA, 4 - MAX, 5 - MEDIAN, 6 - MIN and 7 - SUM.
Excel FORECAST and other Exponential Smoothing
forecasting functions Solve Exercise No.04

The FORECAST.ETS.CONFINT function is used to calculate the confidence interval for a forecasted
value. The confidence interval is kind of a measure of the prediction accuracy. The smaller the interval, the
more confidence in the prediction for a specific data point.

Similar to that of the FORECAST.ETS function, except this additional argument:


Confidence level (optional) - a number between 0 and 1 that specifies a level of confidence for the calculated interval. For
instance, to set a 90% confidence level, you enter either 0.9 or 90%.
▪ If omitted, the default value of 95% is used.

To find out the range within which the forecasted values are likely to fall, you can calculate the confidence
interval bounds for each data point.
✓ Lower bound - subtract the confidence interval from the forecasted value;
✓ Upper bound - add the confidence interval to the forecasted value

Lastly, highlight the data plot and used Excel Forecast Sheet from the Data Tab to create graphs.
Excel FORECAST and other Exponential Smoothing
forecasting functions Solve Exercise No.04

The FORECAST.ETS.SEASONALITY function is used to calculate


the length of a recurring pattern in the specified timeline. It is
closely tied with FORECAST.ETS because both functions use the same
algorithm to detect seasonality.

Returns the
seasonality 7, which
perfectly agrees with
the weekly pattern of
our historical data.
Excel FORECAST and other Exponential Smoothing
forecasting functions Solve Exercise No.04

The FORECAST.ETS.STAT function in returns a specified statistical value relating to


a time series exponential smoothing forecasting.

The statistic type argument indicates which statistical value to return:


1) Alpha (base value) - the smoothing value between 0 and 1 that controls the weighting of data points. The higher the value, the
more weight is given to recent data.
2) Beta (trend value) - the value between 0 and 1 that determines the trend calculation. The higher the value, the more weight is given
to recent trends.
3) Gamma (seasonality value) - the value between 0 and 1 that controls the seasonality of the ETS forecast. The higher the value, the
more weight is given to the recent seasonal period.
4) MASE (mean absolute scaled error) - a measure of the forecast accuracy.
5) SMAPE (symmetric mean absolute percentage error) - a measure of accuracy based on percentage or relative errors.
6) MAE (mean absolute error) - measures the average magnitude of the prediction errors, regardless of their direction.
7) RMSE (root mean square error) - a measure of the differences between the predicted and observed values.
8) Step size detected - the step size detected in the timeline.
FORECAST by applying Excel NAÏVE forecast
Solve Exercise No.05

➢ Estimating technique in which the last period's actuals are used as this period's forecast,
without adjusting them or attempting to establish causal factors.
➢ The Naïve forecast is normally not very accurate but can be useful to understand and
develop other forecasting models
FORECAST by applying Excel Average forecast
Solve Exercise No.05
Arithmetical Average Formula
Arithmetical average is forecast by adding actual Forecast: April =
𝑱𝒂𝒏𝒖𝒂𝒓𝒚 + 𝑭𝒆𝒃𝒓𝒖𝒂𝒓𝒚 + 𝑴𝒂𝒓𝒄𝒉
numeric values of all previous periods 𝟑
and dividing by the numbers of added periods Forecast: May =
𝑱𝒂𝒏𝒖𝒂𝒓𝒚 + 𝑭𝒆𝒃𝒓𝒖𝒂𝒓𝒚+ 𝑴𝒂𝒓𝒄𝒉 + 𝑨𝒑𝒓𝒊𝒍
𝟒
FORECAST by applying Excel Average forecast
Solve Exercise No.05
Moving Average Formula
Forecast is based on the average of previous Forecast: April =
𝑱𝒂𝒏𝒖𝒂𝒓𝒚 + 𝑭𝒆𝒃𝒓𝒖𝒂𝒓𝒚 + 𝑴𝒂𝒓𝒄𝒉

values from a number of periods (interval) 𝟑


𝑭𝒆𝒃𝒓𝒖𝒂𝒓𝒚+ 𝑴𝒂𝒓𝒄𝒉 + 𝑨𝒑𝒓𝒊𝒍
Forecast: May =
𝟑

Interval = 3
FORECAST by applying Excel Average forecast
Solve Exercise No.05
RUN MOVING AVERAGE IN EXCEL WITH ANALYSIS
TOOLPAK
1) Select the Data menu. Then, in
the Analysis group, select Data Analysis.
2) In the Data Analysis window, select Moving
Average from the list and click OK.
FORECAST by applying Excel Average forecast
Solve Exercise No.05
Weighted Moving Average
Formula
➢ This forecast is nearly the same as the Moving 𝑱𝒂𝒏𝒖𝒂𝒓𝒚 𝒙 𝟏 + 𝑭𝒆𝒃𝒓𝒖𝒂𝒓𝒚 𝒙 𝟐+ 𝑴𝒂𝒓𝒄𝒉 𝒙 𝟑
Average except that it assumes that the most Forecast: April =
𝟔
recent periods are the best predictors.
𝑭𝒆𝒃𝒓𝒖𝒂𝒓𝒚 𝒙 𝟐 + 𝑴𝒂𝒓𝒄𝒉 𝒙 𝟑 + 𝑨𝒑𝒓𝒊𝒍 𝒙 𝟒
➢ Each period that is used for the forecast is given Forecast: May =
a weighting. The largest weight is assigned to the 𝟖
most recent period

Interval = 3
References
WWP Training Limited. (2018). Microsoft Excel Forecasting Data and Analysis. WWP Training Limited.
Analysis Toolpak in Excel. (2020). Retrieved from Wallstreetmojo: https://www.wallstreetmojo.com/analysis-toolpak-in-excel/
Athanasopoulos, R. J. (August 2014). Forecasting : Principles and Practice. OTEXTS.COM.
BANTON, C. (2019, July 14). Calculating Covariance for Stocks. Retrieved from Investopedia:
https://www.investopedia.com/articles/financial-theory/11/calculating-covariance.asp
Cheusheva, S. (2019, March 20). Excel FORECAST and other forecasting functions with formula examples. Retrieved from Excel add-ins
and Outlook tools - Ablebits.com: https://www.ablebits.com/office-addins-blog/2019/03/13/excel-forecast-function-formula-
examples/
Cheusheva, S. (2019, December 04). Linear regression analysis in Excel. Retrieved from Ablebits.com:
https://www.ablebits.com/office-addins-blog/2018/08/01/linear-regression-analysis-excel/
Dube, R. (2019, August 23). How to Run Regression In Excel. Retrieved from Lifewire: https://www.lifewire.com/how-to-run-
regression-in-excel-4690640
Excel AVERAGE Function. (2020). Retrieved from ExcelJet: https://exceljet.net/excel-functions/excel-average-function
Exponential Smoothing. (2019). Retrieved from Easy Excel: https://www.excel-easy.com/examples/exponential-smoothing.html
NGUYEN, J. (2019, November 04). Regression Basics For Business Analysis. Retrieved from Investopedia:
https://www.investopedia.com/articles/financial-theory/09/regression-analysis-basics-business.asp
Regression. (2019). Retrieved from Excel Easy: https://www.excel-easy.com/examples/regression.html
Thank You

S-ar putea să vă placă și