Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Alternating Colored Rows in Excel: How-To

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can alternate colored rows in Excel in seconds with a built-in table style, or keep full control with a formula-based conditional formatting rule. The table method is fastest and stays correct when you add data; the formula method works anywhere, including ranges you can't convert to a table. Converting your range with Ctrl+T and picking a banded style handles most cases, so start there and only fall back to conditional formatting when a table doesn't fit your sheet.

What You'll Need

  • Excel for Windows, Excel for Mac, or Excel for the web (the ribbon labels below are the desktop ones; the web version groups some tools differently).
  • A worksheet with a header row in the first row of the data, and no blank rows or columns inside the range.
  • Basic familiarity with selecting a range and the Home tab.

Step-by-Step

  1. Select your data. Click any cell inside the range, then press Ctrl+A (Cmd+A on Mac) to grab the whole block, or drag over it with the mouse. Make sure every column you want striped is included and there are no fully blank rows in the middle, because a blank row tells Excel the data has ended.
  2. Convert the range to a table (fastest route). Press Ctrl+T (Cmd+T on Mac) or go to Insert > Table. Confirm the dialog shows the correct range and that "My table has headers" is checked if row 1 holds your column names. Click OK. The range now gets dropdown arrows and a default style.
  3. Apply a banded style. With the table selected, open the Table Design tab on the ribbon and click through the Table Styles gallery. Every style in the gallery is banded, so hovering the options previews the striping live on your data.
  4. Choose zebra striping (alternating every other row). In the Table Style Options group, tick "Banded Rows." Excel stripes the first row after the header in one shade, the next row in another, and repeats. Leave "Banded Columns" unticked unless you also want vertical stripes. If you want a different starting row, keep reading to the notes on first-row banding below.
  5. Adjust the colors. To change the shade, right-click the style you want in the gallery and choose Duplicate, then edit the fill colors in the dialog, or use the Shading bucket on the Home tab to repaint individual stripes. Most people just pick a lighter style from the gallery rather than editing colors.
  6. Use the formula method instead when a table isn't practical. Select the exact range you want striped, for example A2:D500 (leave the header out). Go to Home > Conditional Formatting > New Rule > "Use a formula to determine which cells to format."
  7. Enter the row formula. In the formula box type =MOD(ROW(),2)=0 to color even rows, or =MOD(ROW(),2)=1 to color odd rows. The reference stays relative to the top-left cell of your selection, which is why you must not use an absolute reference like $A$2 here.
  8. Pick the fill color. Click Format, go to the Fill tab, choose a light shade, and click OK twice. The striping appears instantly.
  9. Make it start on the row you want. If the first striped row is the header or an unwanted row, swap between the =0 and =1 formulas, or offset the comparison with =MOD(ROW()-2,2)=0 to shift the pattern so the first data row is colored.
  10. Change the color later. With a cell in the range selected, go to Home > Conditional Formatting > Manage Rules, select the rule and click Edit Rule > Format to swap the fill. For a table, just pick a different style in the gallery.
  11. Test it with new data. Type a value into the row immediately below a table and it extends automatically, stripes included. With the formula method, copy the formatting down first (or select a range larger than you need when you create the rule) because the rule only covers cells you applied it to.

Common Mistakes

  • Including the header row in the formula range. Row 1 often lands on the wrong parity, so the header ends up colored or the first data row doesn't get a stripe. Start the range at row 2 and adjust the offset formula accordingly.
  • Using an absolute reference in the formula. =MOD(ROW($A$2),2)=0 evaluates against one fixed row, so the whole range colors identically. Keep it as ROW() with no argument.
  • Leaving blank rows inside the data before pressing Ctrl+T. Excel stops the table at the gap, so rows below are not striped and later pasted data breaks the pattern.
  • Manually filling every other row with the paint bucket. It looks right until you sort, filter or insert a row, at which point the stripes belong to the wrong records. Always use a table style or a conditional formatting rule.
  • Forgetting that banded rows and manual fills fight each other. A manual fill sits on top of the table style, so a "missing" stripe is usually just leftover formatting. Select the range and use Home > Clear > Clear Formats to reset it.

Tips

  • Choose low-contrast shades, such as white and a pale grey or blue, so the striping guides the eye instead of competing with your data. Dark alternating bands make small text hard to read and print badly.
  • Keep conditional formatting rules on whole-column-free ranges like A2:D500 rather than entire columns. Applying rules to entire columns slows large workbooks and colors rows far below your data.
  • If you need stripes only where a row actually has content, combine the parity test with a blank check: =AND($A2<>"",MOD(ROW(),2)=0). Empty rows then stay white.
  • Print settings can hide your work. Check Page Layout > Print Titles and the print preview to confirm gridlines and fills render as expected, especially on black-and-white printers where two similar greys look identical.
  • When several sheets need the same look, set up one sheet, then copy the formatted range and use Paste Special > Formats on the others, or duplicate a table style across workbooks by copying a styled table.

Troubleshooting

No stripes appear after adding the rule. Check that the rule's "Applies to" range matches your selection and that the formula uses a relative row reference. Open Manage Rules and look for a conflicting rule higher in the list with "Stop If True" ticked, which can block the banding rule.

Stripes shift after sorting or filtering. This is the main reason to avoid manual fills. A table style and a MOD(ROW()) rule both recalculate against the visible position, though be aware the row formula colors by physical row number, so filtering can make the visible stripes look uneven. That is expected behavior, not a fault.

The table extends but the striping stops. Close and reopen the workbook, or check Table Design > Table Style Options to confirm Banded Rows is still ticked. If the table was pasted as values, it isn't a table anymore.

Colors look wrong in print or PDF. Print preview can drop cell fills if "Draft quality" is enabled in Page Setup, and some printers render pale shades as white. Pick a slightly darker shade and test one page before printing a long report.

If that did not work, clear all formatting from the range, reapply either method from scratch, and check for merged cells, which interfere with both table creation and conditional formatting rules.

Frequently Asked Questions

Can I alternate colors by column instead of row?

Yes. In a table, tick "Banded Columns" in Table Style Options. With a formula, use =MOD(COLUMN(),2)=0 applied to the range.

Will the stripes update when I add rows?

With a table, yes, automatically. With conditional formatting, only within the range you applied the rule to, so size the range generously or copy the formatting down.

How do I remove the striping?

For a table, pick a style without banding or untick Banded Rows. For conditional formatting, use Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells.

Can I use more than two colors?

Not with the built-in table banding, which alternates two shades. You can stack several conditional formatting rules with different MOD arithmetic, but three or more colors usually makes a spreadsheet harder to read.

Does this work in Google Sheets?

Google Sheets has its own version: select the range, then Format > Alternating colors, which offers preset styles and custom color pickers. The menu labels differ from Excel's.

Why do my stripes disappear when I paste data in?

Pasting with normal paste can overwrite the fills and rules underneath. Use Paste Special > Values to drop only the numbers in and leave the formatting intact.