What is a Rolling Average?
A rolling average, also called a moving average, is a technique that smooths out short-term fluctuations in data and highlights longer-term trends. It works by taking the average of a fixed number of consecutive observations (called the window) and then shifting that window forward one data point at a time.
For example, a 7-day rolling average of daily temperatures calculates the average temperature for Days 1 through 7, then Days 2 through 8, then Days 3 through 9, and so on. Each average becomes one point in the smoothed series.
Analysts commonly use rolling averages in time series data, such as stock prices, weather trends, or COVID-19 case counts. They reduce noise from day-to-day variation and help reveal the underlying pattern.
A good rule of thumb is to select a window size that reflects a natural cycle in the data. For instance, a 7-day window often works well for daily data with weekly patterns, such as retail sales or hospital admissions. Matching the window to the cycle helps the average filter out repeating ups and downs while preserving meaningful trends.
How to Calculate a Rolling Average
The following steps show you how to calculate a rolling average:
- Choose a window size such as 3, 7, or 30.
- For each position in the data series, take the average of the current value and the values that come before it (for a trailing average), using the total number of values in the window.
- Slide the window forward by one data point and repeat.
For example, suppose we have daily sales data for seven days:
5, 8, 6, 7, 10, 12, 9
The 3-day rolling average values are:
- Day 3: (5 + 8 + 6) ÷ 3 = 6.33
- Day 4: (8 + 6 + 7) ÷ 3 = 7.00
- Day 5: (6 + 7 + 10) ÷ 3 = 7.67
- Day 6: (7 + 10 + 12) ÷ 3 = 9.67
- Day 7: (10 + 12 + 9) ÷ 3 = 10.33
Each value reflects the local trend over a short window of time.
For example, a 7-day rolling average of daily new COVID-19 deaths helped public health officials understand whether deaths are rising or falling without being misled by single-day spikes or dips due to reporting delays.

