logo
search
Function Problems

How to Calculate a Rolling Three-Week Average using Excel AVERAGEIFS

Phi Hung VoPhi Hung Vo Oct 16, 2026 869 views

Question details

The user needs to construct a dynamic AVERAGEIFS formula to calculate a rolling three-week average for a specific individual based on historical data.

How to Calculate a Rolling Three-Week Average with the AVERAGEIFS Formula
Product
Spreadsheet
Device & OS
not provided
Scenario
Filtering raw weekly data by a specific person's name and dynamically calculating the average of the current week plus the two previous weeks.
Observed behavior
The user wants the correct syntax to evaluate a dynamic date/week range while successfully resolving a parse error caused by an extra comma in the original formula.
Before you start

Ensure your raw data contains well-structured columns: one for the values to be averaged, one for the person's name (or criteria), and one for numerical week numbers.

Solution 1Recommended

Apply the AVERAGEIFS Formula for Dynamic Date Ranges

Use the AVERAGEIFS function to calculate the average of cells that meet multiple criteria, including a dynamic three-week rolling timeframe.

The AVERAGEIFS function evaluates multiple conditions at once. By combining it with dynamic cell references and logical operators, you can create a rolling average that automatically updates as the current week progresses without requiring manual formula adjustments.

1
Select the target cell

Click on the empty cell where you want the rolling three-week average result to be displayed.

2
Enter the AVERAGEIFS formula

Type the formula: =AVERAGEIFS(Sheet1!G:G, Sheet1!E:E, B2, Sheet1!A:A, "<="&X2, Sheet1!A:A, ">="&X2-2) into the formula bar.

3
Verify your cell references

Ensure that Sheet1!G:G is your numerical value column, Sheet1!E:E contains the names, B2 contains the target person's name, Sheet1!A:A contains the week numbers, and X2 represents the current week.

4
Check for syntax errors

Make sure there are no extra commas at the end of the formula or between the arguments. Press Enter to calculate the result.

Apply the AVERAGEIFS Formula for Dynamic Date Ranges
Syntax Tip: When using operators like greater than or less than with cell references, you must enclose the operator in quotation marks and combine it with the cell reference using the ampersand (&) symbol.
Master Advanced Formulas Easily

Calculate Complex Rolling Averages Effortlessly in WPS Spreadsheet

WPS Spreadsheet fully supports advanced logical formulas like AVERAGEIFS, making it incredibly easy to track rolling averages, filter multi-criteria data, and build dynamic dashboards.

  1. 1. Open your data file: Launch WPS Spreadsheet and open your workbook containing the raw weekly data.
  2. 2. Insert the formula: Select the target cell, navigate to the Formulas tab, and insert the AVERAGEIFS function.
  3. 3. Apply the criteria: Define your sum range, person criteria, and week number boundaries using the intuitive function arguments dialog.
  4. 4. Drag to fill: Use the fill handle at the bottom right of the cell to drag and apply the rolling average formula to other rows.
Fully compatible with Microsoft Excel formulas, ensuring AVERAGEIFS works perfectly.Built-in error checking highlights syntax issues like extra commas instantly.Handle large datasets and multi-criteria conditions without lagging.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my AVERAGEIFS formula return a syntax error?

This commonly happens if there is an extra comma at the end of your criteria arguments, or if you forgot to use the ampersand (&) to concatenate logical operators (like "<=") with cell references.

How can I change the formula to calculate a rolling four-week average?

To expand the timeframe to four weeks, update the final argument in the formula from ">="&X2-2 to ">="&X2-3. This includes the current week and the three previous weeks.

Can AVERAGEIFS handle blank cells in the sum range?

Yes, the AVERAGEIFS function automatically ignores empty cells or cells containing text within the sum range, so they will not skew your rolling average.

Why am I getting a #DIV/0! error with AVERAGEIFS?

The #DIV/0! error occurs when no cells meet all the specified criteria (meaning it tries to divide by zero). Check if the person's name matches exactly and that the week numbers fall within the specified boundaries.