How to Calculate a Moving Average in Microsoft Excel

In financial modelling, sales forecasting, and inventory tracking, raw day-to-day data frequently exhibits erratic peaks and valleys caused by weekend closures, seasonal volatility, or one-off events. Calculating a moving average (also termed a rolling average) dampens this transient statistical noise, revealing underlying long-term trends and growth trajectories.

Whether you need a 3-day, 7-day, or 30-day rolling baseline, Microsoft Excel offers multiple straightforward methods to calculate moving averages using dynamic standard formulas or the built-in Data Analysis ToolPak.

Method 1: Calculate a Moving Average Using the AVERAGE Function

The standard and most versatile way to generate a rolling average is applying Excel’s native AVERAGE function across a sliding relative range:

  1. Ensure your chronological dates or time intervals are ordered sequentially down Column A (e.g., from cell A2 to A100), with corresponding numeric values in Column B (cells B2 to B100).
  2. Decide on your smoothing period interval. For example, for a 3-period moving average, navigate to row 4 (the third data point, cell C4).
  3. In cell C4, enter the following formula:
=AVERAGE(B2:B4)
  1. Press Enter. Cell C4 now computes the arithmetic mean of the first three data points.
  2. Double-click or drag the small fill handle in the lower-right corner of cell C4 down the length of Column C.

Because the range reference B2:B4 uses relative cell addressing without dollar signs ($), Excel automatically shifts the window down row by row (computing B3:B5 in cell C5, B4:B6 in cell C6, and so on), producing an unbroken rolling trendline.

Method 2: Prevent Early Missing-Data Errors via IF and COUNT

If you enter a moving average formula into the very first row before enough historical intervals exist, your calculation can produce skewed representations. You can enforce a validation threshold:

=IF(ROW()-ROW($B$2)+1 < 7, "", AVERAGE(B2:B8))

This conditional wrapper instructs Excel to leave the cell completely blank until at least seven full periods of historical metrics have accumulated, ensuring visual cleanliness on executive summary dashboards.

Method 3: Calculate via the Data Analysis ToolPak

For automated reporting, statistical charting, and standard error outputs without manual formula entry:

  1. Navigate to the Data tab on the Excel ribbon.
  2. In the Analysis group on the far right, click Data Analysis. (If this button is missing, enable it via File > Options > Add-ins > Excel Add-ins > check Analysis ToolPak).
  3. In the dialogue box, select Moving Average and click OK.
  4. In the Input Range field, select your dataset (e.g. $B$2:$B$50).
  5. In the Interval field, enter your desired window duration (e.g. 7 for a 7-day average).
  6. Specify an Output Range in a blank column and check the box for Chart Output.
  7. Click OK.

Excel immediately populates the calculated values and embeds a synchronized line chart superimposing the smoothed moving average directly over your raw data.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.