Formula Errors

How to Add a Formula After Every Two Consecutive Cells in WPS Spreadsheets

Ayan MasoodAyan Masood Nov 13, 2026 868 views

Question details

The user needs a repeating formula that adds two consecutive cells at defined row intervals and leaves all other rows blank.

Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
In a worksheet with recurring data blocks, the user wants a sum to appear after every two consecutive cells instead of manually creating a total row each time.
Observed behavior
The formula should calculate only on target rows, such as every third row, and return blank or no calculation on all other rows.
Before you start

Open the workbook in WPS Spreadsheets and confirm the row interval and exact cell references where the first two consecutive values are located.

Solution 1Recommended

Use MOD(ROW()) to Add Two Consecutive Cells at a Fixed Row Interval

Use this method when your worksheet has a regular pattern and you want the addition formula to run only on every Nth row while other rows stay blank.

This method uses MOD(ROW(),N) to detect the target rows. It is best for fixed intervals where the same relative cell references apply in each data block.

1
Select the first target cell

Open the workbook in WPS Spreadsheets and click the cell where the first total should appear. Type =IF(MOD(ROW(),3)=0,D3+D4,"") in the formula bar and press Enter.

2
Apply the formula to the remaining rows

Move the pointer to the lower-right corner of the selected cell until the fill handle appears, then drag it down through the rows that should use the repeating rule.

3
Check the row interval and cell references

If your data pattern is different, replace 3 with the required interval and replace D3+D4 with the two consecutive cells you want to add.

Use MOD(ROW()) to Add Two Consecutive Cells at a Fixed Row Interval
Repeating total added: The formula now calculates only in the target rows and leaves all other rows blank.
WPS Spreadsheets formula help

Repeat an Addition Formula Every Third Row in WPS Spreadsheets

Use WPS Spreadsheets to enter a repeating IF/MOD/ROW formula that adds two consecutive cells only on the desired rows, then fill it down to keep the rest of the worksheet clean.

  1. 1. Open the workbook: Launch WPS Office and open your .xlsx file in WPS Spreadsheets.
  2. 2. Enter the repeating formula: Click the first target cell, type =IF(MOD(ROW(),3)=0,D3+D4,"") in the formula bar, and press Enter.
  3. 3. Fill down the formula: Drag the fill handle from the lower-right corner of the cell down to the last row where the pattern should apply.
  4. 4. Adjust the interval and references: Change 3 to your interval and update D3+D4 to match the two consecutive source cells in your layout.
Creates a repeating sum after every two consecutive cells without manual entryUses familiar Excel functions such as MOD, ROW, and IFFully compatible with Microsoft Excel .xlsx filesFree and lightweight alternative for formula-based spreadsheet tasks
microsoft office alternative - wps office

Frequently Asked Questions

Can I change the formula to total after every 5 or 10 rows instead of every 3 rows?

Yes. Replace the 3 in =IF(MOD(ROW(),3)=0,D3+D4,"") with your interval, such as 5 or 10, and adjust the cell references so the formula runs only when MOD(ROW(),interval)=0.

How can I make the formula stay blank until both source cells contain values?

Use =IF((D3<>"")*(D4<>""),D3+D4,""). This returns the sum only when both D3 and D4 are populated; otherwise the cell stays blank.

Why does the formula show 0 instead of blank on some rows?

If the source cells are empty, D3+D4 can return 0. Use the IF condition that checks both cells, or apply custom number formatting to hide zero values.

Can I use this repeating addition formula in both WPS Spreadsheets and Excel?

Yes. WPS Spreadsheets supports the same MOD, ROW, and IF functions, and the workbook remains compatible with Microsoft Excel .xlsx files.

How do I apply the same repeating logic across columns instead of rows?

Use COLUMN() instead of ROW() and anchor the row references, for example =IF(MOD(COLUMN(),3)=0,$D3+$E3,""), then copy the formula across columns.