Excel Shading Every Other Row: Two Easy Methods
In this article
To shade every other row in Excel, the fastest method is to convert your data range into a Table by pressing Ctrl + T, which automatically applies banded rows. For more customized control without using a table, you can use Conditional Formatting with the formula =MOD(ROW(),2)=0 to apply a fill color to every even-numbered row. This technique, often called "zebra striping," improves readability by helping the eye track data across a horizontal line without getting lost in dense datasets.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A dataset with at least two columns and several rows of data to make the shading visible.
- Basic familiarity with the Excel Ribbon interface.
Step-by-Step
Depending on whether you want a quick automated solution or a highly customized look, choose one of the following two methods. Note that menu labels may differ slightly depending on your version of Excel or regional settings.
Method 1: Using the Excel Table Feature (Fastest)
- Select your data: Click any single cell within your data range, or click and drag to highlight the entire area you want to shade.
- Insert the Table: Go to the Insert tab on the Ribbon and click the Table button. Alternatively, press the keyboard shortcut Ctrl + T (Windows) or Cmd + T (Mac).
- Confirm Range: A dialog box will appear asking "Where is the data for your table?" Excel usually detects the range automatically. Ensure the "My table has headers" checkbox is checked if your first row contains titles. Click OK.
- Choose a Style: Once the table is created, the Table Design tab will appear in the Ribbon. In the Table Styles group, click the dropdown arrow to browse various pre-set color schemes. Most of these include "Banded Rows" by default.
- Toggle Banding: If the shading is not appearing, look at the Table Style Options group on the Table Design tab and ensure the Banded Rows checkbox is checked.
Method 2: Using Conditional Formatting (Most Flexible)
- Highlight the Range: Click and drag to select all the cells, rows, and columns where you want the alternating colors to appear. If you want the entire sheet shaded, click the triangle in the top-left corner of the grid.
- Open Conditional Formatting: On the Home tab, locate the Styles group and click Conditional Formatting. From the dropdown menu, select New Rule...
- Enter the Formula: In the "New Formatting Rule" window, select the last option: Use a formula to determine which cells to format.
- Type the Logic: In the box labeled "Format values where this formula is true," type exactly:
=MOD(ROW(),2)=0. This formula tells Excel to check the row number; if the row number divided by 2 has a remainder of 0 (meaning it is an even row), the formatting will be applied. - Set the Color: Click the Format... button. In the window that opens, go to the Fill tab. Select the specific background color you want for your shaded rows (usually a light gray or light blue). Click OK.
- Finalize: Click OK again to close the New Formatting Rule window. Your selected range will now have shading on every even row.
Common Mistakes
One of the most frequent errors is applying Conditional Formatting to a range and then manually inserting new rows. While the formula =MOD(ROW(),2)=0 is dynamic and will update as you add rows, manually coloring cells with the Paint Bucket tool (Fill Color) will override the conditional formatting. If you manually color a cell, the "zebra stripe" will be hidden by that manual color, creating a break in the pattern.
Another common mistake occurs when users select only a few columns but expect the shading to extend across the entire sheet. Conditional Formatting only applies to the cells that were highlighted at the moment the rule was created. To fix this, you must go to Conditional Formatting > Manage Rules and update the "Applies to" range to include the missing columns.
When using the Table method, users often forget that converting a range to a Table adds filter arrows to the header row. If you do not want these arrows, you must go to the Table Design tab and uncheck Filter Button. Some users mistake this for a bug, but it is a standard feature of Excel Tables.
Tips
For a professional look, avoid using high-contrast or dark colors for your shading. Dark backgrounds require white or light-colored text to remain readable. A light gray (such as "White, Background 1, Darker 5%" or "15%") is typically the best choice for business reports as it provides enough contrast to guide the eye without distracting from the data itself.
If you want the shading to start on the odd rows instead of the even rows, simply change the formula to =MOD(ROW(),2)=1. This tells Excel to shade rows where the remainder is 1 when divided by 2.
If you are using a Table and want the shading to be vertical (every other column) instead of horizontal, go to the Table Design tab and uncheck Banded Rows, then check Banded Columns. This is particularly useful for wide datasets where the number of columns exceeds the number of rows.
To quickly remove all shading, you can either convert the Table back to a normal range (Table Design > Convert to Range) or clear the formatting rules (Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells).
Troubleshooting
The shading is not appearing: First, check if you have any manual fill colors applied to the cells. Manual formatting takes precedence over Conditional Formatting. To fix this, select the area and set the Fill Color to "No Fill." If that doesn't work, check your formula for typos; a missing comma or parenthesis in =MOD(ROW(),2)=0 will cause the rule to fail.
The stripes are inconsistent: This often happens if rows have been hidden or filtered. If you have filtered your data, the ROW() function still references the actual row number in the spreadsheet, not the visible row number. This means you might see two white rows in a row because the even-numbered row was filtered out. To solve this, you would need a more complex formula using the SUBTOTAL function, but for most users, the Table method is the best fix because Table banding adjusts automatically to filtered views.
The formatting is slowing down my workbook: If you apply Conditional Formatting to thousands of rows across an entire sheet, Excel may lag. To improve performance, limit the "Applies to" range to only the cells containing data rather than selecting entire columns (e.g., use A1:Z1000 instead of A:Z).
Frequently Asked Questions
Can I use different colors for the odd and even rows?
Yes. If using Conditional Formatting, you need to create two separate rules. Create one rule with =MOD(ROW(),2)=0 for the even rows and a second rule with =MOD(ROW(),2)=1 for the odd rows, assigning a different color to each.
Will the shading stay if I sort my data?
Yes, both the Table method and the Conditional Formatting method are tied to the row position, not the specific data. When you sort your data, the rows move, but the shading remains in the same alternating pattern.
How do I remove the shading from a Table?
Go to the Table Design tab and uncheck the Banded Rows box. If you want to remove the Table functionality entirely but keep the data, click Convert to Range in the Table Design tab.
Does this work in Excel Online (Web version)?
Yes, both the Table feature and Conditional Formatting are available in the web version of Excel, though the interface may look slightly different than the desktop application.
Can I shade every third row instead of every second?
Yes, using Conditional Formatting. Change the formula to =MOD(ROW(),3)=0. This will apply the shading to every third row (rows 3, 6, 9, etc.).