FormulaCraft

How to shade every other row in Excel and Google Sheets

Topic:Conditional formatting
Excel & Google Sheets
=MOD(ROW(),2)=0

Verified example

Computed by a real spreadsheet engine on the sample data below.

ProductSales
Apples120
Bananas85
Cherries200
Dates60

=MOD(ROW(),2)=0FALSE

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Select the entire data range, e.g. A1:D20.
  2. 2Open Conditional Formatting and add a new 'Use a formula' rule.
  3. 3Enter =MOD(ROW(),2)=0 and pick your shading color. This highlights even-numbered rows. For odd rows use =MOD(ROW(),2)=1.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

How do I start the shading on the first data row, not the header?

If your header is in row 1, use =MOD(ROW()-1,2)=1 so that row 2 (the first data row) is shaded and alternates from there.

More on Conditional formatting

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: