How to Fix SUMIF and MOD Formulas to Sum Every Nth Row in Excel
Question details
The user needs to correct an Excel array formula combining SUM, IF, and MOD to sum values at regular 10-row intervals, specifically when the source data range begins on a row other than a multiple of 10, such as row 8.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Attempting to sum every 10th row in a dataset where the starting row does not naturally align with a standard modulo zero calculation.
- Observed behavior
- The standard formula fails to sum the correct intervals because the MOD calculation assumes the data range aligns perfectly with absolute row multiples, missing the intended rows when the dataset starts on an offset row like I8.
Verify the exact starting cell of your data range and decide whether your Nth row calculation should be relative to the top of the data or tied to the absolute row numbers on the worksheet.
Use a Relative Row Offset in the Array Formula
Subtracting the starting row number inside the formula ensures your interval pattern always begins exactly at the first cell of your selected range, regardless of where the data is placed.
This method normalizes your data array to an index starting at zero. By calculating the difference between the current row and the starting row, the MOD function accurately identifies every 10th relative row independently of the absolute worksheet structure.
Click on the cell where you want the final sum to be displayed.
Type the formula: =SUM(IF(MOD(ROW($I$8:$I$80)-ROW($I$8),10)=0,$I$8:$I$80))
Press Ctrl+Shift+Enter to apply the formula. In newer versions of Excel, you may simply press Enter.

Adjust the MOD Condition to Target Specific Row Numbers
If you prefer not to use relative offsets, you can manually change the expected MOD remainder to match the absolute row numbers you wish to target.
Easily Manage Complex Array Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports complex array formulas, including nested SUM, IF, MOD, and ROW functions. You can execute advanced conditional calculations seamlessly with a familiar interface that handles heavy data efficiently.
- 1. Open your dataset in WPS: Launch WPS Spreadsheet and open the document containing your data.
- 2. Select the target cell: Click on the blank cell where you want to output the sum of every 10th row.
- 3. Enter the array formula: Paste your combined SUM, IF, and MOD formula directly into the formula bar.
- 4. Apply array processing: Press Ctrl+Shift+Enter to wrap the formula in curly braces and process the array calculation instantly.

Frequently Asked Questions
Why do I need to press Ctrl+Shift+Enter for this formula?
Combining SUM and IF with calculations over a range of cells creates an array formula. Pressing Ctrl+Shift+Enter encloses the formula in curly braces {}, commanding the software to evaluate each cell in the designated range individually before calculating the total.
Can I use this formula to calculate an average instead of a sum?
Yes, you can substitute the SUM function with AVERAGE, such as =AVERAGE(IF(MOD(ROW($I$8:$I$80)-ROW($I$8),10)=0,$I$8:$I$80)). Because the IF function ignores FALSE values by default, the skipped rows will not skew your average with zeros.
Is it required to add a zero for the FALSE argument in the IF statement?
No, it is generally better to omit the FALSE argument entirely. If you put 0 as the FALSE condition and later switch your formula from SUM to AVERAGE, those zeros will be included in the calculation and drastically lower your resulting average.




