How to Exclude Alternating Rows in Excel Using SUMPRODUCT
Question details
The user needs to multiply values across two columns and sum the results while ignoring specific alternating rows (either all odd or all even rows).

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Calculating a conditional sum of products where periodic rows must be excluded from the calculation array.
- Observed behavior
- The user requires a formula combination using SUMPRODUCT to conditionally filter rows before multiplication and summation are executed.
Ensure your data ranges are identically sized and do not contain error values, as errors in the referenced columns will cause the SUMPRODUCT formula to return an error.
Use SUMPRODUCT with MOD and ROW Functions
Combine SUMPRODUCT with MOD and ROW to conditionally calculate sums of products for only even or odd rows.
The SUMPRODUCT function natively multiplies corresponding components in arrays and returns the sum of those products. By nesting the MOD and ROW functions within it, you can create a True/False array that acts as a filter, effectively zeroing out the rows you want to exclude.
Click on the cell where you want the final calculated result to appear.
Type =SUMPRODUCT((MOD(ROW(A2:A101),2)=0)*A2:A101*B2:B101) into the formula bar. This includes only even rows and excludes odd rows. Adjust the data ranges (A2:A101 and B2:B101) to match your actual worksheet data.
If you need to include only odd rows (excluding even rows), change the =0 in the formula to =1. The formula will become =SUMPRODUCT((MOD(ROW(A2:A101),2)=1)*A2:A101*B2:B101).
Press the Enter key to apply the array logic and view your conditional sum product result.

Calculate Complex Array Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas like SUMPRODUCT, ROW, and MOD. You can easily calculate conditional sums and exclude alternating rows just as you would in Microsoft Excel, entirely for free.
- 1. Open your workbook: Launch WPS Spreadsheet and open your existing .xlsx data file.
- 2. Select a calculation cell: Click on the blank cell where you want to display the final result.
- 3. Enter the SUMPRODUCT formula: Type your conditional formula, such as =SUMPRODUCT((MOD(ROW(A2:A101),2)=0)*A2:A101*B2:B101), directly into the formula bar.
- 4. Get the result instantly: Press Enter to instantly process the array filter and calculate the conditional sum of products.

Frequently Asked Questions
Can I use SUMPRODUCT to exclude rows based on specific text instead of alternating rows?
Yes. Instead of using MOD and ROW, you can use a logical condition like =SUMPRODUCT((C2:C101<>"ExcludeText")*A2:A101*B2:B101) to skip rows where column C contains a specific text string.
Why does my SUMPRODUCT formula return a #VALUE! error?
This error typically occurs if the arrays referenced in the formula (such as A2:A101 and B2:B101) are not the exact same size, or if you are attempting to multiply text strings without converting or ignoring them properly.
Does this formula work the same way in WPS Office as it does in Excel?
Absolutely. WPS Spreadsheet shares full formula compatibility with Microsoft Excel. It supports the exact same SUMPRODUCT, MOD, and ROW syntax, ensuring your array formulas work seamlessly across both platforms.
How can I exclude every third row instead of alternating rows?
To exclude every third row, simply change the divisor in the MOD function. For example, use MOD(ROW(A2:A101),3)<>0 inside your SUMPRODUCT condition to keep the first two rows and exclude the third in every block of three rows.




