How to Work with Every Other Row Using MOD and ROW
Combine MOD and ROW to flag, count and total alternate rows — like day and night shifts in a machine export.
You will learn to
- Total every other row
- Count alternate rows that meet a target
- Calculate a rate from alternating rows
How it works
ROW() returns a cell’s row number and MOD(…,2) turns it into 0 for even rows and 1 for odd rows. =MOD(ROW(),2)=0 is the classic formula for banding every other row with conditional formatting or flagging alternate records.
The same idea works on whole ranges: =SUMPRODUCT((MOD(ROW(B2:B9),2)=0)*B2:B9) adds only the even rows. Change 2 to 3 for every third row, or subtract the first row number to start the pattern wherever your data begins.
=SUMPRODUCT((MOD(ROW(B2:B9),2)=0)*B2:B9)