Calculation Issues

Excel: Calculate the Average of Every 24 Rows

Phi Hung VoPhi Hung Vo Nov 12, 2026 869 views

Question details

The user needs to automate averages for consecutive, non-overlapping groups of 24 values in a large spreadsheet.

Product
Microsoft Excel and WPS Spreadsheet
Device & OS
not provided
Scenario
The dataset contains values arranged in consecutive rows or a named range, and the user wants one average for each group of 24 values without selecting every group manually.
Observed behavior
A manual range such as AVERAGE(C2:C25) calculates only one group or creates a rolling average when copied, rather than returning separate averages for each 24-row block.
Before you start

Confirm whether the values are arranged horizontally or vertically, and identify the exact source range or named range. Decide whether the final partial group should also be averaged when fewer than 24 values remain.

Solution 1Recommended

Use BYROW and WRAPROWS for consecutive groups in Microsoft 365

Use this approach when the values are in a horizontal range or named range and your spreadsheet supports dynamic-array functions.

This formula creates rows of 24 values and returns one average for each row. It calculates non-overlapping groups, not a rolling average.

Replace data with the actual range, such as C2:C121, or use an existing named range. The final group can contain fewer than 24 values if the range does not divide evenly.

1
Select the output cell

Open the worksheet in Excel or WPS Spreadsheet and click the blank cell where the first grouped average should appear.

2
Enter the grouped-average formula

Type =BYROW(WRAPROWS(data,24),LAMBDA(x,AVERAGE(x))) and replace data with the source range or named range.

3
Confirm the formula

Press Enter. The spreadsheet should spill one average per group into the cells below the formula.

Avoid a rolling average: Do not use =AVERAGE(C2:C25) when you need separate non-overlapping groups. That formula calculates one 24-row range and becomes a rolling average when copied down.

Calculate grouped 24-row averages in WPS Spreadsheet

WPS Spreadsheet lets you enter Excel-compatible grouped-average formulas, fill or spill the results, and save the completed workbook in XLSX format for easy sharing and continued editing.

  1. 1. Open the workbook: Launch WPS Office, choose Spreadsheet, and open the workbook containing the 24-row dataset.
  2. 2. Choose the output location: Click an empty cell beside or below the source data where the grouped averages should begin.
  3. 3. Enter the formula: Type =BYROW(WRAPROWS(data,24),LAMBDA(x,AVERAGE(x))) using your actual range in place of data, then press Enter.
  4. 4. Check and save the results: Review the spilled averages for each group and select File > Save As to save the workbook as an XLSX file.
Automate averages for consecutive groups of 24 rows instead of selecting each range manuallyUse familiar spreadsheet formulas and an easy-to-navigate worksheet interfaceOpen, edit, and save Microsoft Excel XLSX files with strong format compatibilityWork with large datasets in a lightweight spreadsheet application
microsoft office alternative - wps office

Frequently Asked Questions

How do I average every 24 rows in Excel without creating a rolling average?

Use =BYROW(WRAPROWS(data,24),LAMBDA(x,AVERAGE(x))) in Microsoft 365, replacing data with the source range. This returns one result for each non-overlapping group of 24 values.

Can I calculate grouped averages from a vertical range?

Yes. Use the LET, SEQUENCE, UNIQUE, INDEX, and MAP formula provided for vertical data. Enter it in an empty output cell and replace data with the vertical source range.

What is the difference between a grouped average and a rolling average?

A grouped average returns one result for rows 1-24, another for rows 25-48, and so on. A rolling formula such as =AVERAGE(C2:C25), copied down, recalculates for each row using the current row and previous 23 rows.

What happens if the dataset has fewer than 24 values in the last group?

The dynamic-array formulas can average the remaining values in the final partial group. If you want to exclude incomplete groups, filter or limit the source range to a multiple of 24 before calculating.