Yes, you can shade every other row in Excel without formulas or macros—it just requires a few simple steps. The method uses conditional formatting to apply alternating colors automatically, and it works in Excel for Windows, Mac, and online versions. Below is the fastest way to do it, followed by variations for different data ranges and troubleshooting.
What You'll Need
- Excel 2013 or later (Windows, Mac, or online version)
- A worksheet with at least two rows of data
- Basic familiarity with selecting cells (optional but helpful)
Step-by-Step
- Select the range where you want shading
- Click the top-left cell of your data range (e.g., A1 if your data starts there)
- Drag your cursor diagonally to the bottom-right cell of your range (e.g., D100 for 100 rows and 4 columns)
- Note: The shading will apply to every row in the selected range, not just alternating ones yet. If your data isn’t contiguous (e.g., rows 1–5 and 10–15), skip to Step 5 for a workaround.
- Open the Conditional Formatting dialog
- On the Home tab, click Conditional Formatting in the Styles group
- Choose New Rule (or New Rule... on Mac). A sidebar (or pop-up) will appear.
- Set the rule to format rows with a formula
- In the sidebar, select the second option: Use a formula to determine which cells to format
- Enter this formula in the field:
=MOD(ROW(),2)=0
This tells Excel to shade every even-numbered row (0, 2, 4, etc.). For odd rows, use=MOD(ROW(),2)=1instead. - Click the Format button to customize the shading.
- Apply the fill color
- In the Format Cells dialog, go to the Fill tab
- Choose a color (e.g., light gray or pastel blue) from the Standard or Theme options
- Click OK to close the dialog, then click OK again to apply the rule.
- Verify the shading works
- Scroll down your data—every other row should now have the fill color you selected.
- If nothing appears: Double-check your formula (it must include
ROW()and use=MOD()with 0 or 1). Also ensure your selected range includes all rows you want shaded.
Common Mistakes
These errors happen most often when applying alternating row shading:
- Wrong formula
- Using
ROW(A1)instead of justROW()(the latter references the current row dynamically). - Forgetting the equals sign (=) before the formula.
- Using
- Incorrect range selection
- Not selecting all rows you want to shade (e.g., selecting only A1:D5 instead of A1:D100).
- Including header rows in the range—shading will apply to them too.
- Overwriting formatting
- Accidentally applying a different fill color to the selected range later (e.g., via formatting buttons). This doesn’t remove the conditional rule but can obscure the effect.
- Using absolute row references
- Typing
=MOD(10,2)=0(hardcoding a row number) instead of the dynamicROW()function.
- Typing
Tips for Better Results
- Start with headers by excluding them
- Instead of selecting A1:D100, select A2:D100 to skip shading row 1 (headers).
- If you must include headers, manually clear their shading afterward by right-clicking the cells > Clear Formats.
- Use lighter colors for readability
- Avoid dark shades (e.g., black or navy) as they reduce contrast with text. Stick to light gray, mint green, or pastel yellow.
- Test with your data’s text color to ensure legibility (e.g., black text on light gray is fine; black on white is not).
- Apply to columns instead of rows (if needed)
- To shade every other column, use this formula:
=MOD(COLUMN(),2)=0(Replace COLUMN() with your column reference, e.g., COLUMN(A:A)).
- To shade every other column, use this formula:
- Update rules for dynamic ranges
- If your data grows (e.g., new rows are added), the shading will automatically expand only if your initial range was set to the last row with data. To ensure this, select your data first (e.g., A1:D1000) and let Excel auto-fill the row number dynamically.
- Combine with other formatting
- Add bold headers, borders, or conditional formatting for totals while keeping the row shading. These rules stack independently.
For large datasets, group rows - If your data is in a table or grouped by categories, apply the shading rule to the entire table (not just rows). This ensures sub-groups also alternate.
Troubleshooting
If your shading isn’t working, try these fixes in order:
- Check the formula
- Right-click the shaded rows > Conditional Formatting Rules Manager (or go to Home > Conditional Formatting > Manage Rules).
- Verify the formula is
=MOD(ROW(),2)=0(or=1for odd rows). If it’s incorrect, edit it and click OK.
- Ensure the range is selected correctly
- Deselect any highlighted cells and reselect the range (e.g., click A1, then drag to the last row/column of data).
- If your data has gaps (e.g., rows 1–5 and 10–15), you’ll need to apply the rule separately to each contiguous block.
- Test with a small sample
- Select just 4–6 rows (e.g., A1:A6) and apply the formula manually. If it works here, the issue is with your larger range.
- Clear conflicting formatting
- Right-click the shaded rows > Clear Rules from Selected Cells (or Clear Formats) to reset any accidental overwrites.
- Check for macros or VBA scripts
- If you’ve used macros before, they might interfere. Go to Developer > Macros and delete any rules named "AlternateRow" or similar.
- Reapply the rule
- Delete the existing rule (right-click > Manage Rules > select the rule > Delete), then start over from Step 1.
- Use Excel’s built-in "Table" feature (alternative method)
- If conditional formatting fails, convert your data to a Table (select your range > Insert > Table).
- Go to Table Design > Banded Rows to toggle shading automatically. This works only for contiguous data.
- Last resort: Reinstall Excel
- If all else fails, conditional formatting may be corrupted. Uninstall and reinstall Excel for Windows/Mac, or reset Excel settings via File > Options > Add-ins > Go > Manage Excel Add-ins > Reset all settings.
Frequently Asked Questions
Why does my shading stop after a certain row?
This happens if your selected range doesn’t include all rows you want shaded. For example, selecting A1:D50 will only shade rows 1–50, even if your data goes to row 1000. Always extend your range to the last row of data (or beyond) to ensure full coverage.
Can I shade every other row starting from row 3 instead of row 1?
Yes! Modify the formula to account for your starting row. For example, to start shading from row 3 (skipping rows 1 and 2), use:
=MOD(ROW()-2,2)=0
This shifts the row count backward by 2, beginning the alternating pattern on row 3.
Will this work if I add new rows later?
It depends on how you set the range initially:
- If you selected a fixed range (e.g., A1:D100): The shading will not automatically expand to new rows added beyond row 100. You’ll need to manually reselect the range and reapply the rule.
- If you selected the last row with data dynamically (e.g., A1:D1000): The shading will extend to new rows only if the formula is still valid. For true dynamic behavior, use a macro or table formatting instead.
Can I shade every third row instead of every other row?
Absolutely! Replace the formula with:
=MOD(ROW(),3)=0
for every third row (rows 1, 4, 7, etc.).
For every third row starting from row 2, use:
=MOD(ROW()-1,3)=0
Adjust the number inside MOD() to control the interval (e.g., 4 for every fourth row).
Does this method work in Excel for Mac?
Yes, the process is identical on Excel for Mac. The only difference is the dialog layout:
- On Mac, the "New Rule" option appears after clicking Conditional Formatting > New Rule....
- The formula field is in the same location, and the Fill tab works the same way.
How do I remove the shading if I change my mind?
To delete the shading:
- Right-click any shaded row and select Conditional Formatting > Manage Rules.
- Select the rule for "Alternating row shading" and click Delete.
- Alternatively, select all shaded rows and press Ctrl+Z (or Cmd+Z on Mac) to undo the formatting.
Can I use this with a pivot table?
No, conditional formatting rules applied to a pivot table’s source data will not automatically update when the pivot table changes. Instead:
- Apply shading to the underlying dataset before creating the pivot table.
- Or, manually shade rows in the pivot table’s report after it’s generated (but this requires editing each row individually).