To create alternating shaded rows in Excel, the fastest method is to format your data as a Table via the Insert tab, which automatically applies "Banded Rows." For a more customized approach that does not convert your data into a formal table, use Conditional Formatting with a formula like =MOD(ROW(),2)=0. This technique, often called "zebra striping," significantly improves readability by helping the eye track data across a wide row without getting lost, which is essential for large datasets, financial reports, and inventory lists.
What You'll Need
- Microsoft Excel installed on Windows, macOS, or available via the web browser.
- A dataset with at least two columns and several rows of data to make the shading visible.
- Basic familiarity with the Excel Ribbon interface (the menu at the top of the screen).
Step-by-Step
Method 1: Using Excel Tables (The Fast Way)
Converting a range of cells into an official Excel Table is the most efficient way to achieve alternating colors because the formatting is dynamic; if you add new rows, Excel automatically applies the shading to them.
- Select your data range: Click and drag your mouse to highlight the cells you want to shade. Alternatively, click any single cell within your data set and press Ctrl + A (Windows) or Command + A (Mac) to select the entire contiguous block.
- Insert the Table: Navigate to the Insert tab on the top ribbon and click the Table button. You can also use the keyboard shortcut Ctrl + T (Windows) or Command + T (Mac).
- Confirm the range: A dialog box will appear asking "Where is the data for your table?" Excel will have already guessed the range based on your selection. If your top row contains headers (e.g., Date, Name, Amount), ensure the checkbox "My table has headers" is checked. Click OK.
- Customize the style: Once the table is created, a new tab called Table Design (or just Design) will appear in the ribbon when a cell inside the table is selected. In the Table Styles gallery, you can click the dropdown arrow to choose from dozens of pre-set color combinations.
- Toggle Banded Rows: In the Table Design tab, look for the Table Style Options group. Ensure the Banded Rows checkbox is checked. If you prefer alternating columns instead, check Banded Columns.
Method 2: Using Conditional Formatting (The Custom Way)
Use this method if you want the look of alternating rows without the functional changes that come with a Table (such as automatic filtering buttons in the header or structured references in formulas).
- Select the target area: Highlight the specific rows and columns you want to apply the shading to. If you want the shading to apply to the entire sheet, click the triangle in the top-left corner of the grid.
- Open Conditional Formatting: Go to the Home tab, click Conditional Formatting in the Styles group, and select New Rule... from the dropdown menu.
- Choose the rule type: In the New Formatting Rule window, click the bottom option: "Use a formula to determine which cells to format."
- Enter the MOD formula: In the box labeled "Format values where this formula is true," type exactly:
=MOD(ROW(),2)=0.- Technical explanation: The ROW() function returns the number of the current row. The MOD function returns the remainder after division. Since we are dividing by 2, any even-numbered row will result in a remainder of 0, making the statement true and triggering the color.
- Set the fill color: Click the Format... button. In the Format Cells dialog, go to the Fill tab. Select a light grey or a pale color from the palette (dark colors can make text hard to read). Click OK.
- Apply the rule: Click OK again to close the New Formatting Rule window. Your selected range will now have alternating shaded rows.
Common Mistakes
One of the most frequent errors occurs when users manually color rows using the Fill bucket tool. While this works for five or ten rows, it becomes a nightmare when the dataset grows. If you manually color rows and then sort your data, the colors stay with the cells rather than the row position, resulting in two white rows or two grey rows next to each other. This ruins the "zebra" effect and requires you to manually re-color the entire sheet.
Another common mistake is selecting the header row when applying the MOD formula in Conditional Formatting. If your header is in Row 1, the formula =MOD(ROW(),2)=0 will shade Row 2, 4, 6, etc. If you want the shading to start on the first row of data (Row 2) but the formula is behaving unexpectedly, check if you have hidden rows or filtered data, as this can sometimes make the pattern appear broken.
Users also frequently forget that Table Styles are tied to the Table object. If you convert a Table back to a normal range (via Table Design > Convert to Range), the alternating colors often remain as static formatting, but they lose their dynamic ability to auto-expand when new data is typed at the bottom.
Tips
For a professional look, avoid high-contrast colors. Instead of bright blue or yellow, use a very light grey (like "White, Background 1, Darker 5%") or a pale version of your company's primary brand color. This ensures that the black text remains the focal point and the shading serves as a subtle guide rather than a distraction.
If you are using the Conditional Formatting method and want the odd rows shaded instead of the even rows, simply change the formula to =MOD(ROW(),2)=1. This tells Excel to apply the format whenever the row number divided by 2 leaves a remainder of 1.
To make your data truly pop, combine alternating row shading with a "Freeze Panes" setup. Go to the View tab > Freeze Panes > Freeze Top Row. This keeps your headers visible while you scroll through your perfectly shaded rows, making the data navigation seamless.
Troubleshooting
The shading disappeared after I sorted my data: This usually happens if you used manual fill colors. To fix this, clear all fill colors (Home > Fill Color > No Fill) and apply the Table method or Conditional Formatting method described above. These methods are "position-aware" and will maintain the pattern regardless of how the data is sorted.
The MOD formula isn't coloring any cells: First, check for typos in the formula. Ensure there is an equals sign at the start and that the parentheses are closed. Second, check if there is already a fill color applied to the cells. Conditional Formatting layers on top of existing colors, but if you have another Conditional Formatting rule with a higher priority, it might be overriding your shading. Go to Conditional Formatting > Manage Rules to check the order of priority.
I can't find the Table Design tab: The Table Design tab is contextual. It only appears when your cursor is actively clicking inside a cell that is part of a formatted Table. If you click a blank cell outside the table, the tab will vanish. Click back into your data to bring it back.
The colors are too dark and I can't see my text: You don't need to delete the rule. If using a Table, simply pick a different style from the Table Styles gallery. If using Conditional Formatting, go to Manage Rules, select your rule, click Edit Rule, and change the Fill color to a lighter shade.
Frequently Asked Questions
Does alternating shading slow down Excel?
For most users, no. Table formatting is very efficient. Conditional Formatting can slightly impact performance in massive spreadsheets (hundreds of thousands of rows) because Excel must recalculate the formula for every cell, but for standard business documents, the impact is negligible.
Can I use alternating colors for columns instead of rows?
Yes. If using a Table, check the "Banded Columns" box in the Table Design tab. If using Conditional Formatting, replace ROW() with COLUMN() in the formula: =MOD(COLUMN(),2)=0.
How do I remove alternating shaded rows?
If you used a Table, go to the Table Design tab and uncheck "Banded Rows." If you used Conditional Formatting, go to Home > Conditional Formatting > Clear Rules > Clear Rules from Entire Sheet.
Will the shading stay if I export the file to PDF?
Yes, any shading applied via Tables or Conditional Formatting is part of the visual layer of the spreadsheet and will be preserved exactly as it appears when saved or printed to PDF.
Can I have three different colors rotating?
Yes, but you must use Conditional Formatting. You would create three separate rules: =MOD(ROW(),3)=0, =MOD(ROW(),3)=1, and =MOD(ROW(),3)=2, assigning a different fill color to each one.