How to Average Every Nth Row in an Excel Column

📅 May 13, 2026 📝 Sarah Miller

Manually calculating averages for recurring intervals-such as every 5th or 10th row-in large Excel datasets is tedious and highly prone to error. While standard AVERAGE functions or manual helper columns are common workarounds, they quickly clutter your workspace and fail to scale.

Leveraging a dynamic array formula automates this process, saving valuable time. Note the stipulation that your dataset must maintain consistent row intervals for this logic to function accurately.

For example, the formula =AVERAGE(IF(MOD(ROW(A1:A100)-ROW(A1)+1, 5)=0, A1:A100)) precisely targets every fifth row. Below, we break down exactly how to configure this formula for your sheet.

How to Average Every Nth Row in an Excel Column

Excel Formula To Average Every Nth Row In A Column

When working with large datasets in Microsoft Excel, you may often find yourself needing to summarize data that repeats at regular intervals. For example, you might have hourly temperature readings and want to average the daily peak at every 24th row, or you may have a financial ledger where you need to calculate the average of quarterly summaries appearing every 3rd row.

Calculating this manually by selecting individual cells (e.g., =AVERAGE(A2, A5, A8, A11...)) is tedious, prone to human error, and completely impractical for datasets containing hundreds or thousands of rows. Fortunately, Excel provides dynamic formulas to automate this task. In this comprehensive guide, we will explore the best formulas to average every Nth row in a column, ranging from modern dynamic array formulas to classic legacy methods and simple helper column alternatives.

Understanding the Logic: The Power of ROW and MOD

Before diving into the formulas, it is crucial to understand the mathematical logic behind how Excel identifies "every Nth row." Excel does not have a built-in function called AVERAGE_EVERY_NTH, so we must build this logic using two primary components:

  • The ROW Function: This returns the index number of a cell's row. For instance, =ROW(A5) returns 5.
  • The MOD Function: The MOD function returns the remainder after a number is divided by a divisor. The syntax is MOD(number, divisor).

By combining these two functions, we can create a mathematical filter. If we want to target every 3rd row starting from row 2, we can subtract our starting row number to establish a relative index, divide by 3, and look for a remainder of 0. Here is how the math breaks down for a series of cells starting at A2:

Cell Reference Row Number (ROW) Relative Index (Row - Start Row) MOD(Relative Index, 3) Should Average?
A2 (Start) 2 2 - 2 = 0 MOD(0, 3) = 0 Yes (1st match)
A3 3 3 - 2 = 1 MOD(1, 3) = 1 No
A4 4 4 - 2 = 2 MOD(2, 3) = 2 No
A5 5 5 - 2 = 3 MOD(3, 3) = 0 Yes (2nd match)
A6 6 6 - 2 = 4 MOD(4, 3) = 1 No
A7 7 7 - 2 = 5 MOD(5, 3) = 2 No
A8 8 8 - 2 = 6 MOD(6, 3) = 0 Yes (3rd match)

Using this logic, we can construct formulas that programmatically isolate the target cells and average them.

Method 1: The Modern Way (Excel 365 & Excel 2021)

If you are using Microsoft 365 or Excel 2021, you have access to dynamic arrays and the powerful FILTER function. This is the cleanest, most intuitive, and easiest-to-read method available.

The Formula Syntax

=AVERAGE(FILTER(data_range, MOD(ROW(data_range) - ROW(start_cell), N) = 0))

Example Scenario

Assume your data is in range B2:B20, and you want to average every 4th row starting from cell B2 (meaning you want to average B2, B6, B10, B14, and B18). Use the following formula:

=AVERAGE(FILTER(B2:B20, MOD(ROW(B2:B20) - ROW(B2), 4) = 0))

How It Works

  1. ROW(B2:B20) generates an array of actual row numbers: {2, 3, 4, 5, ..., 20}.
  2. ROW(B2:B20) - ROW(B2) normalizes the row numbers to start at zero: {0, 1, 2, 3, 4, ..., 18}. This step is critical because it ensures your offset starts precisely on your first selected cell, regardless of where your data sits on the sheet.
  3. MOD({0, 1, ...}, 4) calculates the remainder of each of those numbers divided by 4. This outputs {0, 1, 2, 3, 0, 1, 2, 3, 0...}.
  4. The expression = 0 evaluates each item to a boolean array of TRUE or FALSE. It will be TRUE for elements with a remainder of 0.
  5. The FILTER function extracts only the values from B2:B20 where the corresponding condition is TRUE.
  6. Finally, AVERAGE takes those filtered numbers and returns the average.

Method 2: The Classic Array Formula (Excel 2019 and Older)

If you are supporting users on older versions of Excel (such as Excel 2019, 2016, or 2013), you will not have access to the FILTER function. Instead, you must use a traditional array formula using AVERAGE combined with a nested IF statement.

The Formula Syntax

=AVERAGE(IF(MOD(ROW(data_range) - ROW(start_cell), N) = 0, data_range))

Note: Because this is an array formula in legacy Excel versions, you must press Ctrl + Shift + Enter instead of just pressing Enter. When done correctly, Excel will automatically wrap the formula in curly braces { }.

Example Scenario

Using the same data from B2:B20 and averaging every 4th row, the formula is:

{=AVERAGE(IF(MOD(ROW(B2:B20) - ROW(B2), 4) = 0, B2:B20))}

How It Works

The IF function evaluates the row pattern. If the modulo condition is met, it returns the value from B2:B20. If the condition is not met, it returns FALSE. Since the AVERAGE function is programmed to ignore logical FALSE values, it safely calculates the mathematical average of only the matching rows.

Method 3: The Helper Column Approach (Simple & Great for Large Workbooks)

If you are building a workbook for beginners who might get confused by complex array formulas, or if you want an easy way to visualize and verify which rows are being picked, the Helper Column method is an excellent alternative.

Step-by-Step Implementation

  1. Insert a new column next to your data (let's say Column C, next to data in Column B). Let's name the header "Is Target".
  2. In cell C2, enter the following formula to identify every Nth row (e.g., N=3):
    =MOD(ROW(B2) - ROW($B$2), 3)
  3. Drag this formula down to the bottom of your data range. It will populate with repeating numbers: 0, 1, 2, 0, 1, 2...
  4. In your summary cell, use a standard AVERAGEIF formula to average only the rows marked with a 0:
    =AVERAGEIF(C2:C20, 0, B2:B20)

The beauty of this method is its simplicity and speed. For incredibly large datasets (tens of thousands of rows), AVERAGEIF performs significantly faster than complex array calculations, keeping your Excel sheet running smoothly.

Handling Offsets and Custom Starting Rows

What if you want to average every 3rd row, but you don't want to start on the first cell? What if your data starts in cell B2, but you want your pattern to begin on cell B4 and grab every 3rd row from there (B4, B7, B10, etc.)?

To offset your starting position, simply modify the start cell reference inside the ROW subtraction. To start at B4, write your formula like this:

=AVERAGE(FILTER(B4:B20, MOD(ROW(B4:B20) - ROW(B4), 3) = 0))

If you cannot change the main range reference but still need to control the offset, you can add an offset value to your relative index calculation. Changing the remainder target in the MOD function from = 0 to = 1 or = 2 shifts the selection index down by that many rows.

Common Mistakes and How to Troubleshoot Them

When working with these mathematical array formulas, a few common errors can crop up. Here is how to fix them:

1. The #DIV/0! Error

This error occurs if Excel cannot find any numbers that match your criteria, or if all the matching cells are empty. Double-check your starting row and your divisor (N) in the MOD function to ensure that your formula is actually hitting cells containing numeric data.

To prevent this error from breaking your spreadsheet layout, wrap your formula in an IFERROR statement:

=IFERROR(AVERAGE(FILTER(B2:B20, MOD(ROW(B2:B20)-ROW(B2), 3)=0)), "No Data Found")

2. Treatment of Blank Cells and Zeroes

It is important to know how Excel treats empty cells versus cells with actual zero values (0):

  • Blank Cells: The AVERAGE function automatically ignores truly blank cells. If every 3rd row is being target-filtered, and one of those targeted cells is completely blank, Excel will calculate the average of the remaining non-blank target cells.
  • Zeroes: If a targeted cell contains an actual 0, Excel will include this in the calculation, which will pull your average down. If you want to exclude zeroes, you need to add an extra condition to your FILTER function.

To average every 3rd row in B2:B20 excluding zero values, modify the FILTER function to evaluate both conditions like this:

=AVERAGE(FILTER(B2:B20, (MOD(ROW(B2:B20) - ROW(B2), 3) = 0) * (B2:B20 <> 0)))

In Excel logic, multiplying conditions acts as an AND operator. The formula will now filter for rows that meet our interval math AND are not equal to zero.

Conclusion

Averaging every Nth row in a column is a powerful technique for data sampling, interval reports, and parsing structured ledger exports. If you are on Microsoft 365 or Excel 2021, the AVERAGE(FILTER(...)) approach is by far the most modern and scalable solution. For older Excel versions, the CSE array formula (using Ctrl+Shift+Enter) does the job perfectly. Finally, if you value visual transparency or seek optimal computational speed on massive sheets, the trusty helper column with a basic AVERAGEIF formula remains an outstanding architectural choice. Pick the method that best matches your workbook design, and stop wasting valuable time selecting rows manually!

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.