Function Problems

Filter a Named Range by Employee Group for a 90-Day Average in Excel or Google Sheets

John WilsonJohn Wilson Nov 12, 2026 868 views

Question details

Calculate a rolling 90-day average of hours for employees who belong to a selected named employee group.

Filter a Named Range by Employee Group for a 90-Day Average
Product
Microsoft Excel or Google Sheets
Device & OS
not provided
Scenario
The worksheet uses named ranges for hours, dates, employee names, and an employee group such as Technicians or Advisors.
Observed behavior
The average should include only records dated from 90 days ago through today where the employee appears in the selected group.
Before you start

Make sure the Hours, Date, and Employee named ranges have matching row counts and that the Date range contains real date values. Confirm that the employee-group named range, such as Technicians or Advisors, contains the employee names exactly as they appear in the source data.

Solution 1Recommended

Use FILTER and XMATCH to average records for the selected employee group

Use this method in Excel versions that support dynamic arrays, or in Google Sheets where the required functions are available.

The formula filters the hours range using three conditions: the date is within the last 90 days, the date is not later than today, and the employee name is found in the selected employee group. AVERAGE then calculates the result from the filtered hours.

1
Set the rolling start date

In a cell or named formula, enter =TODAY()-90 and name it NinetyDaysAgo if you want to use the formula exactly as shown.

2
Enter the filtered average formula

Select the result cell and enter =AVERAGE(FILTER(TableHours,(TableDate>=NinetyDaysAgo)*(TableDate<=TODAY())*ISNUMBER(XMATCH(TableEmployee,Technicians))))

3
Switch to another employee group when needed

Replace Technicians in the formula with Advisors, or replace it with a cell reference that contains the name of the named employee-group range.

4
Check the calculated result

Press Enter and confirm that only rows within the 90-day period whose employee names occur in the selected group contribute to the average.

Use FILTER and XMATCH to average records for the selected employee group
Check function availability: FILTER and XMATCH behavior can differ by Excel version and Google Sheets. If XMATCH is unavailable, use the MATCH alternative in the next solution.
WPS Spreadsheet formula tools

Calculate Employee Group Averages with WPS Spreadsheets

WPS Spreadsheets lets you organize employee data with named ranges and calculate rolling averages with date and employee-group criteria. Use familiar spreadsheet formulas and filter functions to analyze hours without changing your workbook structure.

  1. 1. Open the employee-hours workbook: In WPS Office, open the workbook from the Home screen or select Menu > Open and choose the Excel file.
  2. 2. Create or verify named ranges: Select each source range, then use Formulas > Define Name to create names such as TableHours, TableDate, TableEmployee, and Technicians.
  3. 3. Choose the output cell: Click an empty cell where the rolling average should be displayed.
  4. 4. Enter the group-filtered average: Type =AVERAGE(FILTER(TableHours,(TableDate>=TODAY()-90)*(TableDate<=TODAY())*ISNUMBER(MATCH(TableEmployee,Technicians,0)))) and press Enter.
  5. 5. Review and update the group list: Edit the cells in the Technicians named range or substitute another group range, such as Advisors, to update the calculation.
Create named ranges for employee names, hours, dates, and group lists.Filter hours by a rolling 90-day date range and employee membership.Open and edit Microsoft Excel .xlsx and .xls workbooks with compatible spreadsheet formatting.Use a familiar worksheet interface for formula entry, named ranges, and data analysis.
microsoft office alternative - wps office

Frequently Asked Questions

How do I change the formula from Technicians to Advisors?

Replace Technicians in the membership portion of the formula with Advisors. The Advisors named range must contain the employee names that should be included.

Why does my 90-day average formula return no result?

Verify that TableDate contains valid dates, that its rows align with TableHours and TableEmployee, and that at least one employee name exactly matches an entry in the selected group range.

Can I use a cell to select the employee group dynamically?

Yes. If a cell contains the text name of a named range, use INDIRECT with that cell where the group range is referenced. For example, replace Technicians with INDIRECT(A1) when A1 contains Technicians.

What does ISNUMBER(XMATCH(TableEmployee,Technicians)) do?

XMATCH searches each value in TableEmployee within the Technicians range. It returns a position for matches, and ISNUMBER converts those matches into TRUE values that FILTER can use.

Does the formula include dates exactly 90 days ago and today?

Yes. The >=NinetyDaysAgo and <=TODAY() conditions include records dated exactly 90 days ago and records dated today.