Calculation Issues

Calculate and Chart a Seven-Day Rolling Average in Excel

Aamir Naveed AkramAamir Naveed Akram Nov 18, 2026 873 views

Question details

Calculate and chart seven-day rolling averages for daily COVID-19 positivity rates.

How to Calculate a Seven-Day Rolling Average in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user has daily positivity rates and wants a line chart showing the average for each seven-day period.
Observed behavior
Excel's Moving Average tool reports that the input range must contain at least one data point.
Before you start

Arrange dates in consecutive daily order in column A and numeric positivity percentages in column B, starting in row 2. Check that percentages are stored as numbers rather than text and that missing dates are represented by rows.

Solution 1Recommended

Use a formula to calculate and chart the rolling average

Use this method to calculate a complete seven-day average without relying on the Moving Average tool.

1
Enter the daily data

Place dates in A2 downward and the corresponding daily positivity percentages in B2 downward. Add a heading such as Seven-Day Average in C1.

2
Calculate the first average

Select C8 and enter =IF(COUNT(B2:B8)=7,AVERAGE(B2:B8),NA()). This averages the current day and previous six days only when all seven cells contain numbers.

3
Copy and format the formula

Drag the fill handle from C8 down through the remaining data rows. Select column C and choose Home > Percent Style.

4
Create the chart

Select the dates in column A and the rolling averages in column C, including their headings, then choose Insert > Line Chart. Set the chart title to “Knox County, Ohio Positivity Rates: 7-Day Rolling Averages,” or use a title appropriate to your data.

Use a formula to calculate and chart the rolling average
Incomplete periods: The formula returns #N/A when a seven-row window contains fewer than seven numeric values. Keep one row per calendar day so each window represents seven days.
Calculate in WPS Spreadsheets

Create a Seven-Day Rolling Average in WPS Spreadsheets

Use the same seven-day formula in WPS Spreadsheets, then chart the results alongside your dates.

  1. 1. Open your data: Open your workbook in WPS Spreadsheets and arrange dates in column A and daily percentages in column B, starting in row 2.
  2. 2. Enter the formula: Select C8 and enter =IF(COUNT(B2:B8)=7,AVERAGE(B2:B8),NA()).
  3. 3. Fill and format: Drag the fill handle down column C, then select the results and choose the percentage format from the Home tab.
  4. 4. Insert a chart: Select the dates and rolling-average values, choose Insert > Chart, and select a line chart.
Calculate rolling averages with familiar spreadsheet functionsCreate a line chart of daily positivity trendsOpen and edit Microsoft Excel XLS and XLSX filesUse a free, easy-to-use spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the first seven-day average appear in row 8?

If the first daily value is in B2, B2:B8 contains the first seven values. Enter the formula in C8 to align the average with the seventh day.

Why does the formula return #N/A?

The formula returns #N/A when COUNT finds fewer than seven numeric values in the window. Check the corresponding cells in column B for blanks, text-formatted percentages, or other nonnumeric entries.

Why does Excel say the Moving Average input range has no data points?

The selected range may be empty or contain percentages stored as text. Check the values in column B, then reopen Data > Data Analysis > Moving Average and select the numeric data range.

Is the average of daily positivity rates the same as the combined seven-day positivity rate?

Not necessarily. The formula averages the seven daily percentages equally. For a combined rate, divide the total positive tests over the seven days by the total tests over those days.