Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Forecasting Models in Excel: Step-by-Step Guide

· 11 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can build forecasting models in Excel using its built-in data analysis and charting tools, which provide a solid foundation for predicting future trends based on historical data. This guide walks through creating a simple linear forecast, a moving average forecast, and using the more robust FORECAST.ETS function for seasonal data, ensuring your numbers are accurate and actionable.

What You'll Need

  • A computer with Microsoft Excel installed (2016 or later is recommended for the best experience with new functions).
  • A dataset with at least two columns of data: one for the time periods (e.g., months, quarters) and one for the values you want to forecast (e.g., sales, temperature).
  • A basic understanding of how to use the fill handle and drag-and-drop in Excel.

Step-by-Step

Part 1: Preparing Your Data

Before applying any formulas or tools, your data must be structured correctly for Excel to interpret it. Forecasting models rely on the relationship between time and value; if your data is messy, the results will be unreliable.

  1. Organize your data into two columns. The first column should contain the time periods. This can be dates, month names, or sequential numbers (1, 2, 3...). The second column should contain the numerical values corresponding to those periods. Ensure there are no blank cells in either column, as these will break the calculation.
  2. Sort your data chronologically. Click anywhere inside your dataset, go to the Data tab on the ribbon, and click Sort. Ensure the sort is by the time period column in ascending order (oldest to newest). This step is critical because most forecasting functions assume your data is in a time series sequence.
  3. Label your headers. In the first row of your data, type a clear label for the time column (e.g., "Month") and a label for the value column (e.g., "Sales"). Do not put any data in the header row itself. This helps Excel identify the range automatically and prevents errors in your final chart.
  4. Check for seasonality (optional but recommended). If you are working with data that repeats every year (like retail sales), ensure that your chronological order reflects the seasons. For example, January should come before February. This ensures that the seasonal component of your model is calculated correctly.

Part 2: Creating a Moving Average Forecast

A moving average forecast smooths out short-term fluctuations and highlights longer-term trends or cycles. It is useful for identifying the general direction of your data without being thrown off by a single spike or drop.

  1. Select the cell where you want the first forecasted value to appear. This should be directly below your last known data point in the value column. For example, if your sales data ends in December, select the cell below it (January of the next year).
  2. Type the formula for a moving average. The syntax is =AVERAGE(range). Replace "range" with the data range you want to average. For a simple 3-period moving average, if your data is in cells C2 to C14, type =AVERAGE(C2:C14). This will calculate the average of the last three months of data.
  3. Drag the formula down. Click on the cell with the formula you just typed, then click and drag the small square handle in the bottom-right corner of the cell down as far as you want the forecast to go. Excel will automatically adjust the range for each cell, creating a series of averaged values.
  4. Interpret the results. The moving average will lag behind the actual data. If your data is trending upwards, the moving average will be lower than your actual values. This is because it is averaging past values that were lower. Conversely, if data is falling, the moving average will be higher than the actual values.

Part 3: Creating a Linear Forecast (Trend Line)

A linear forecast assumes that the relationship between time and your data is a straight line. It is best suited for data that is growing or shrinking at a relatively constant rate over time.

  1. Create a chart for your data. Highlight both your time period and value columns. Go to the Insert tab and click on the Recommended Charts button. Choose a line chart with markers, as this is the standard visualization for time-series data. This chart will serve as the visual basis for your forecast.
  2. Add a trendline to the chart. Click on any line in your chart to select it. Right-click and choose Add Trendline from the context menu. In the Format Trendline pane that appears on the right side of the screen, look at the options on the left.
  3. Configure the trendline settings. Check the box labeled Set Intercept if you want the line to start at a specific point on the vertical axis. Leave it unchecked if you want the line to be calculated based on the data. You can also choose a different Trendline Options like Exponential or Polynomial, though linear is the default and the most straightforward for most users.
  4. Show the forecast on the chart. In the Format Trendline pane, look for the section titled Forecast. Here you can specify the number of periods to project forward. Simply type a number into the Forward box. You can also set the Forecast End date directly if you prefer. As soon as you type in this box, the chart will immediately update and extend the line into the future.
  5. Display the equation and R-squared value. It is crucial to see the math behind the line. In the Format Trendline pane, check the boxes labeled Display Equation on chart and Display R-squared value on chart. The R-squared value (between 0 and 1) tells you how well the line fits your data. An R-squared value closer to 1 indicates a strong fit, while a value closer to 0 indicates a weak fit.

Part 4: Using the FORECAST Function

For a more precise and automated approach, you can use specific forecasting functions like FORECAST.LINEAR or FORECAST.ETS. These functions calculate the forecast value based on historical data and a specified target date.

  1. Use FORECAST.LINEAR for simple trends. This function is ideal for data that follows a straight line. Select an empty cell for the result. The syntax is =FORECAST.LINEAR(x, known_y's, known_x's). The x is the target date or period for which you want a prediction. The known_y's are the values from your dataset (e.g., your sales numbers). The known_x's are the time periods corresponding to those values (e.g., 1, 2, 3... or your month names).
  2. Use FORECAST.ETS for seasonal data. If your data has clear seasonal patterns (e.g., higher sales in December every year), use this function instead. It handles seasonality automatically. The syntax is =FORECAST.ETS(target_date, values, timeline, [seasonality], [data_completion], [aggregation]). The seasonality argument is particularly useful; you can set it to 1 to let Excel detect the seasonality, or specify a number like 4 for quarterly data.
  3. Drag the function down. Once you enter the function for the first future period, you can drag the fill handle down to generate a full series of forecasted values for all future periods.

Part 5: Visualizing the Forecast

A forecast is only as good as its presentation. A clear chart helps stakeholders understand the prediction and its confidence interval.

  1. Create a combined chart. It is often best to combine your historical data with your forecasted data on the same chart. You can do this by highlighting your entire dataset (including the forecasted values you just calculated), going to Insert > Recommended Charts, and selecting Combo. Choose a line chart for the historical data and a line chart (or scatter plot) for the forecasted data, making sure to check the box that says Secondary Axis if your forecasted values are on a much different scale than your historical values.
  2. Add a trendline with confidence intervals. When you add the trendline, look for the option to display the Confidence Intervals. This is often found under Fill & Line in the pane. This adds shaded areas around the forecast line, representing the range of possible outcomes. A wider shaded area indicates more uncertainty in the prediction.
  3. Format the chart for clarity. Remove gridlines that are not necessary, ensure the axis labels are readable, and add a title that clearly states what is being forecasted. A good title might be: "Projected Sales for the Next 6 Months".

Common Mistakes

  • Ignoring data quality. The most common mistake is using data with missing values or outliers. An outlier—a single data point that is vastly different from the rest—can skew the entire trendline. Always clean your data before forecasting, which may involve removing or adjusting these points.
  • Using the wrong function. Using a linear forecast on data that has strong seasonality (like summer temperatures or holiday sales) will produce misleading results. The FORECAST.ETS function is specifically designed to handle these patterns.
  • Overfitting the data. If you choose a trendline with too many complex options (like a high-order polynomial), your model might fit the historical data perfectly but fail to predict future values accurately. Stick to simpler models unless you have a specific reason to use a more complex one.
  • Forgetting to check the R-squared value. The R-squared value is a quick check for the validity of your model. If it is very low (close to 0), your chosen trendline is not a good fit for the data. You should try a different type of trendline or reconsider your data.

Tips

  • Start small. Before forecasting for a long period, test your model on a shorter timeframe to see if the results make sense. If your model predicts a massive drop in sales next month, but you know you have a major marketing campaign planned, you have a red flag that your model needs adjustment.
  • Use consistent units. Ensure your data is in consistent units. Mixing data from different sources with different scales (e.g., dollars versus thousands of dollars) will break your formulas and lead to incorrect forecasts.
  • Update regularly. A forecast is a snapshot in time. As new data comes in, you must update your model. The best practice is to set up your spreadsheet so that you can simply paste the new data into the existing table, and the forecast will update automatically.
  • Understand the limitations. Excel's built-in forecasting tools are based on statistical assumptions. They are not a crystal ball. They are best used for making informed estimates based on past patterns. They cannot predict sudden, unforeseen events or black swan events.

Troubleshooting

If your forecast is not working as expected, check these common issues first.

  • The formula returns a #VALUE! error. This usually happens when the ranges for the known values and the target dates are not of the same size. Double-check that the number of values matches the number of time periods.
  • The forecasted values are all the same. This indicates that your data might be flat or constant. A linear trendline cannot forecast from a flat line. You may need to use a different method or collect more data that shows a clear trend.
  • The trendline equation looks strange. If the equation shows numbers like 1E+09, it is likely because the data is on a very large scale. You can change the number format of the cells to Scientific notation or use a smaller unit to make the numbers more readable.
  • The forecast is not extending past the last data point. Ensure that the target date you are using in the FORECAST function is actually a future date. If you try to forecast for a date that has already passed, Excel will return the actual value from the historical data.
  • The chart is not updating. If you change a value in your dataset, the chart might not update automatically. Go to the Design tab, click Select Data, and ensure the data range is correct. Alternatively, you can right-click on the chart and choose Refresh.

Frequently Asked Questions

Can I forecast data with missing values?

Yes, the FORECAST.ETS function has an optional argument called [data_completion]. If you set this to 1, it will automatically interpolate missing data points to improve the accuracy of the forecast.

How do I know if my forecast is accurate?

There is no single number that measures accuracy perfectly. However, you can compare your forecasted values to actual values after the period has passed. The Mean Absolute Percentage Error (MAPE) is a common metric used to evaluate forecast accuracy. You can calculate this in Excel by finding the average of the absolute percentage difference between the forecast and the actual value.

What is the difference between FORECAST and FORECAST.ETS?

The main difference is how they handle seasonality. FORECAST.LINEAR assumes a straight-line relationship and does not account for seasonality. FORECAST.ETS is an Exponential Triple Smoothing function that is designed to detect and account for seasonal patterns in your data.

Can I use Excel to forecast multiple variables at once?

Yes, you can use the Data Analysis Toolpak. This add-in provides tools for multiple regression, which can be used to forecast a dependent variable based on multiple independent variables. You can enable this add-in by going to File > Options > Add-ins and selecting Excel Add-ins.

Why does my forecast go off the charts?

If your forecasted values exceed the scale of your chart, Excel will automatically adjust the vertical axis to accommodate them. This is normal behavior. However, if the forecasted values are drastically different from your historical data, it might indicate that the trend is accelerating rapidly, which could be a sign of an unreliable model.

Is there a limit to how many data points I can forecast?

There is no hard limit in the software, but Excel may become slow or unresponsive with very large datasets. Generally, a few hundred data points is fine, but for tens of thousands of points, you might need to use a more specialized statistical tool.