Skip to the stories
Excel & Power BI

Excel Moving Averages: Build Weighted and Exponential Calculations

  • Frédéric LE GUEN
  • 952 views

Excel’s WMA and EMA respond faster to recent data than a simple average. Here are the formulas, period choices and tradeoffs.

Excel Moving Averages: Build Weighted and Exponential Calculations

A simple moving average smooths sharp changes, but it can take time to catch up when a trend shifts. Weighted and exponential moving averages address that lag by giving more influence to recent values. In Excel, both methods are straightforward to calculate; choosing between them depends on how quickly you need the average to respond and how much you want it to react to isolated spikes.

The examples below use daily temperatures from New York at the start of January 2020. A three day period keeps the arithmetic easy to check. The same ideas apply to sales, website visits and other time series.

Choose a period that fits the data

The period determines how many observations shape the calculation. A longer period produces a smoother line, but it takes longer to reflect a change. A shorter period responds sooner and can show more of the day to day variation.

  • Seven days can smooth daily sales or website visits by covering a full week, including weekday and weekend patterns.
  • Three or 12 months can be used for monthly figures. A 12 month period includes a full seasonal cycle.
  • 20, 50 or 200 days are commonly used periods for stock prices. Twenty trading days is roughly one month of trading.

These are starting points, not rules that fit every data set. Match the period to the rhythm you want to smooth. When you change it, update the formula’s data range and the weights or smoothing factor as well. For a 10 day exponential moving average, for example, alpha is 2 / (10 + 1), or about 0.18.

Calculate a weighted moving average

A weighted moving average (WMA) assigns a different weight to each value in the period. In this three day example, the oldest temperature gets a weight of 1, the middle value gets 2, and the latest gets 3. The latest observation therefore influences the result three times as much as the oldest.

For January 3, the temperatures are 2, 5 and 7. A simple average gives 4.7: (2 + 5 + 7) / 3. With weights of 1, 2 and 3, the weighted result is 5.5: (2 × 1 + 5 × 2 + 7 × 3) / (1 + 2 + 3). That result sits closer to the latest temperature, 7.

image excel exercises

Enter the weights in G2:G4, then place this formula in D4:

=SUMPRODUCT(B2:B4,$G$2:$G$4)/SUM($G$2:$G$4)

Weighted moving average formula

SUMPRODUCT multiplies each temperature by its corresponding weight and adds those products. In this example, that produces 33. Dividing by the total weight, 6, returns the weighted average. When you copy the formula down the column, the temperature range advances to the next rows while the dollar signs keep the weight range fixed at G2:G4.

Read the difference between WMA and SMA

Comparing the weighted average in column D with the simple average in column C gives a quick indication of recent movement. The WMA tends to move ahead of the SMA because it gives more influence to the latest observation. In the temperature data, the WMA is 13.0 versus an SMA of 11.3 on January 12, when values are rising. On January 13, as they fall, the WMA is 10.8 while the SMA is 12.0. When the readings are stable, the two are close: 4.2 and 4.3 on January 8.

To calculate the gap, enter =D4-C4. A positive result means the weighted average is above the simple average; a negative result means it is below. That difference can help indicate the direction of recent movement, though it’s a signal from the data rather than a guarantee that the trend will continue.

image excel quizzes

Calculate an exponential moving average

An exponential moving average (EMA) uses a different approach. Instead of calculating each result from a fixed block of observations, it combines the latest value with the previous EMA. That makes the calculation recursive: each new result carries forward some influence from earlier data, with older observations losing weight over time.

The smoothing factor, alpha, is calculated as 2 / (period + 1). For a three day period, alpha is 0.5, so the current value and previous average each contribute half of the new result. For the first observation there is no previous average to use, so start with the value itself. In E2, enter:

=B2

Then in E3, enter:

=$G$7*B3+(1-$G$7)*E2

Exponential moving average formula in cell E3

Here, G7 holds alpha. Copy the formula down to calculate later values. For January 3, the calculation is 0.5 × 7 + 0.5 × 3.5, giving an EMA of 5.25. The previous average remains part of each new result, but its influence fades as later values are added.

Compare how quickly the averages respond

The difference is clear on January 11, when the temperature rises from 5 to 14 °C. The simple average reaches only 5.7, while the weighted and exponential averages reach 8.3 and 8.5. Both respond more quickly to the jump because they emphasize recent data.

Chart comparing the simple, weighted and exponential moving averages

In practice, faster response comes with a tradeoff: a brief spike can pull a fast average away from the underlying pattern. Comparing a fast average with a slower one can help put that movement in context.

Pick the average for the job

AverageResponseUseful when
Simple (SMA)SlowerYou want a broad view of the trend and less reaction to a single unusual value.
Weighted (WMA)FasterRecent observations are more useful, such as the latest sales figures.
Exponential (EMA)FastestYou want a responsive measure of possible trend changes; it’s also widely used in finance and trading.

For an Excel model, start with the question the moving average needs to answer. Use an SMA for a steadier overview, or a WMA or EMA when recent data should have more influence. Then check the result against the underlying values: a quicker line can reveal a shift sooner, but it can also magnify a one off change.

Source: Frédéric LE GUEN · excel-tutorial.com

Neighbouring cells