This store requires javascript to be enabled for some features to work correctly.

Resources · 13 min read

Zebra Striping In Spreadsheets: The Troubleshooting Guide

Fix broken zebra striping & alternating row colors in any spreadsheet. Little Saints covers the fastest banding methods & formulas that work.
Zebra Striping In Spreadsheets: The Troubleshooting Guide

Key Takeaways

  • Zebra striping (banded rows) improves horizontal scanning across wide tables by taking advantage of how the eye tracks lines.
  • Excel’s Format As Table (Ctrl+T) is the fastest way to apply banding that automatically extends when new rows are added.
  • For filtered lists, use =MOD(SUBTOTAL(103,$A$2:$A2),2)=0 so stripes align only with visible rows.
  • Conditional formatting with =MOD(ROW(),2)=0 works best on static ranges, while tables handle sorting and filtering more reliably.

The Fastest Banding Method In Each App

Most users can fix broken or missing banding in under a minute with these built-in tools.

Choosing A Conditional Formatting Formula

Conditional formatting works well when a table is not appropriate because the range feeds A1-style formulas or the sheet is a static export. Two formulas handle standard banding.

The exact UI path in Excel desktop: Home > Conditional Formatting > New Rule > Use A Formula To Determine Which Cells To Format. Enter the formula in the “Format Values Where This Formula Is True” box, then click Format > Fill to choose a color.

The MOD-based formula is more flexible. Changing the divisor from 2 to 3 or 5 bands every third or fifth row, which ISEVEN cannot do. Both formulas recalculate when rows are added or deleted, so the stripe pattern stays current without manual intervention.

The table below highlights the key tradeoff. Only the SUBTOTAL-based rule and Google Sheets’ built-in banding survive filtering, while the standard MOD formula and Format As Table behave differently under sorting.

Method Best For Survives Filtering Survives Sorting
Format As Table (Ctrl+T) Interactive Data Yes Yes
Conditional Formatting =MOD(ROW(),2)=0 Static Ranges No Yes
Conditional Formatting =MOD(SUBTOTAL(103,$A$2:$A2),2)=0 Filtered Lists Yes Yes
Google Sheets Format > Alternating Colors Google Sheets Users Yes Yes

The table shows that the SUBTOTAL-based rule is the only conditional formatting option that survives filtering. The next section walks through how to build it.

How To Zebra Stripe Only The Visible Rows In A Filtered List

This fix resolves the most common banding failure in filtered lists. The formula is:

=MOD(SUBTOTAL(103,$A$2:$A2),2)=0

Apply it via Home > Conditional Formatting > New Rule > Use A Formula To Determine Which Cells To Format, then choose a fill color. The formula =MOD(ROW(),2)=0 breaks as soon as a filter is applied because ROW() numbers every row on the sheet, hidden or visible, so the stripe pattern counts filtered-out rows and falls out of alignment with what is displayed.

SUBTOTAL(103,...) solves this because it counts only visible rows. Microsoft’s SUBTOTAL documentation maps function codes 1–11 to calculations that include manually hidden rows, while codes 101–111 exclude them. Rows excluded by a filter are always ignored regardless of which code range is used. Code 103 is the visible-only counterpart of COUNTA, so it counts nonblank cells while skipping rows hidden by an Excel filter.

The formula =SUBTOTAL(103,$A$2:$A2) filled down returns 1 for the first visible row and increments only for rows that are currently visible. Wrapping that in MOD(...,2)=0 produces a TRUE or FALSE test that aligns stripes to every second visible row automatically, regardless of which rows the filter hides. This approach requires that column A contains data in every row and that the formula’s range starts at the correct row. Otherwise the count can skip rows and the banding may behave unpredictably.

One practical note: code 103 counts non-empty visible cells rather than row positions, so the referenced column must be populated in every record. If column A has blanks, reference a column that is fully populated instead.

What Happens When You Convert A Range To A Table In Excel

Converting a range to a table with Ctrl+T triggers many changes at once. You get a named object with tracked edges, structured references, auto-fill formulas, filter buttons, an optional Total row, and default banded row formatting. Only three of these changes affect banding directly.

To turn banding off after conversion, go to Table Design > Table Style Options and uncheck Banded Rows. To switch from row banding to column banding, uncheck Banded Rows and check Banded Columns in the same panel.

Converting back also changes behavior. Microsoft confirms that when an Excel table is converted to a range, the Table Design tab disappears from the ribbon, sort and filter arrows are removed, and structured references are converted to normal cell references. Banded row colors are preserved but converted from dynamic table-style attributes into static cell formatting. New rows added later will not inherit the banding automatically. The fix for a growing dataset after conversion is to apply conditional formatting with =MOD(ROW(),2)=0 across a generous range.

How To Alternate Row Colors In Excel Without A Table

Many users need to keep the range as a plain range because it feeds other formulas, merged cells are present, or the file is a static export. In these cases, conditional formatting is the right approach.

  1. Select the full range you want to band.
  2. Go to Home > Conditional Formatting > New Rule.
  3. Select “Use A Formula To Determine Which Cells To Format.”
  4. Enter =MOD(ROW(),2)=0 in the formula box.
  5. Click Format > Fill, choose your color, and click OK.
  6. Click OK again to apply the rule.

The most common failure on a static range occurs when shading stops at row 47 even though data extends to row 212 because the conditional formatting rule was applied only to A1:E47. The fix is to select the full range, go to Home > Conditional Formatting > Manage Rules > Edit Rule, and change the “Applies To” range. Apply the rule to a generous range such as =$A$1:$E$1000 and use =MOD(ROW(),2)=0 without a $ before the row number so the row reference stays relative.

For filtered lists, use the SUBTOTAL-based formula described in the filtered-list section.

Zebra Striping In Excel Online And SharePoint

Excel for the web limits how you can create banding rules. Custom conditional formatting rules for alternating row or column shading cannot be created in Excel for the web. The workaround is to use a table.

Conditional formatting rules created in Excel desktop are preserved and displayed when the workbook is opened in Excel for the web. Since 2020, Excel for the web can also create and edit conditional formatting rules.

Does Zebra Striping Actually Help?

A List Apart’s 2008 zebra striping research, citing secondhand eye-tracking test results, reported that the straightest left-to-right eye path occurred with striping. This finding indicates that banding helps the eye stay on a single row across a wide table.

The underlying eye-tracking evidence supports this conclusion. Rayner (1998), published in Psychological Bulletin, established that the perceptual span during a fixation extends about 14–15 character positions to the right of the fixation point and only 3–4 positions to the left in left-to-right reading languages. That asymmetry makes horizontal tracking across a wide table costly, and banding reduces that cost.

The counterargument is also documented. The same eye-tracking research base used to justify simplified layouts also shows that excessive visual elements may create noise rather than clarifying structure. In practice, banding helps most on wide tables with many columns and many rows, and it helps least on narrow tables where the eye does not need to travel far.

Frequently Asked Questions

Why Does My Zebra Striping Break When I Apply A Filter In Excel?

The standard banding formula, =MOD(ROW(),2)=0, evaluates the physical row number on the sheet. When a filter hides rows, those rows still carry their row numbers, so the formula counts them even though they are invisible. The result is that the stripe pattern no longer aligns to the visible rows, so two visible rows can share the same color and the alternation disappears.

The fix is the SUBTOTAL-based formula described earlier: =MOD(SUBTOTAL(103,$A$2:$A2),2)=0. SUBTOTAL with function code 103 counts only non-empty visible cells, incrementing by one for each row that is currently displayed. Wrapping that count in MOD produces a TRUE or FALSE test that tracks visible rows rather than physical row positions, so the stripes stay aligned no matter which rows the filter hides. Apply this formula via Home > Conditional Formatting > New Rule > Use A Formula To Determine Which Cells To Format, and make sure the referenced column is fully populated so the count does not skip rows with blank cells.

What Is The Difference Between =MOD(ROW(),2)=0 And =ISEVEN(ROW()) For Banding?

Both formulas produce identical results for standard even and odd alternation. =MOD(ROW(),2)=0 works by dividing the row number by 2 and testing whether the remainder is zero, and =ISEVEN(ROW()) performs the same test with cleaner syntax.

The practical difference is flexibility. As covered earlier, MOD can be adapted for any interval by changing the divisor, while ISEVEN is limited to even and odd. For most banding use cases the two are interchangeable. For anything beyond standard alternation, MOD is the better choice.

Neither formula is designed to handle filtered lists correctly because both count hidden rows the same as visible ones. For filtered lists, use =MOD(SUBTOTAL(103,$A$2:$A2),2)=0 instead.

Does Converting A Range To An Excel Table Permanently Change My Formatting?

Converting a range to a table changes formatting behavior, but you can revert most of it. When a range is converted to an Excel table, the default table style applies its own formatting, including banded rows and background fills, which overrides manual cell fills already in place, though the original manual formatting can be restored by selecting the “None” table style or clicking Clear. Existing conditional formatting rules survive the conversion but are scoped to fixed ranges rather than the table itself, so they no longer expand automatically with new data.

Converting the table back to a range preserves the visual appearance because the banded colors remain on the cells, but they are converted from dynamic table-style attributes into static cell formatting. New rows added after conversion will not inherit the banding. The Table Design tab disappears from the ribbon, sort and filter arrows are removed, and any structured references in formulas are rewritten to standard A1-style cell references without warning.

If the goal is to keep banding on a growing dataset after converting back to a range, apply a conditional formatting rule with =MOD(ROW(),2)=0 across a generous range such as =$A$1:$E$1000. That rule extends the stripe pattern to any new rows added within that range without requiring manual updates.

Why Can’t I Create Alternating Row Colors In Excel Online?

Excel for the web does not support creating custom conditional formatting rules for alternating row or column shading. This limitation is documented for the web version. The workaround is to format the data as a table. When a table is created in Excel for the web, every other row is shaded by default, and that banding persists as rows are added or deleted.

If the banding rule needs to be created or edited, for example to use the SUBTOTAL-based formula for a filtered list, open the file in the Excel desktop application, make the change, and save. Conditional formatting rules created or changed in the Excel desktop application are preserved and visible when the workbook is reopened in Excel for the web, and Excel for the web gained the ability to create and edit conditional formatting in 2020. For SharePoint-hosted workbooks, the same constraint applies: banding is a table feature in that environment, and the fix for broken banding is to ensure the data is formatted as a table with Banded Rows enabled under Table Design.

How Do I Fix Zebra Striping That Stops Partway Through My Data?

This problem almost always comes from a range that is too small. When a conditional formatting rule is applied to a selection such as A1:E47 and data later extends to row 212, the rule does not cover the new rows. The stripes stop where the original selection ended.

The fix is straightforward. Click any cell in the banded range, go to Home > Conditional Formatting > Manage Rules, and select Edit Rule. Change the “Applies To” field to a range that covers the full extent of the data, or apply it generously to a range like =$A$1:$E$1000 to accommodate future growth. Make sure the formula uses a relative row reference, =MOD(ROW(),2)=0 without a $ before the row number, so the rule evaluates correctly for each row rather than locking to a single position. Click OK to apply, and the banding extends through the full dataset immediately. For a filtered list, use =MOD(SUBTOTAL(103,$A$2:$A2),2)=0 and apply it to the same generous range.


The statements made on our website have not been evaluated by the Food and Drug Administration, Our products are not intended to diagnose, treat, cure or prevent any disease. If you are pregnant, nursing, taking any medications or have any medical conditions, consult your doctor before use.