To make every other cell gray in Excel, the fastest method is to convert your data range into a Table by pressing Ctrl + T and selecting a banded row style. For more custom control, you can use Conditional Formatting with the formula =MOD(ROW(),2)=0 to apply a gray fill to every even-numbered row automatically. This technique, known as "banded rows" or "zebra striping," significantly improves the readability of large datasets by helping the eye track information across a horizontal line without skipping rows.
What You'll Need
- A computer with Microsoft Excel installed (works on Office 365, Excel 2021, 2019, 2016, and Excel for the Web).
- A dataset or a blank worksheet where you want to apply the alternating colors.
- Basic familiarity with selecting cell ranges using the mouse or keyboard.
Step-by-Step
Depending on whether you want a quick automated solution or a highly customized look, there are two primary ways to achieve the gray alternating cell effect. Note that menu labels may differ slightly depending on your version of Excel or your region.
Method 1: Using Excel Tables (The Fastest Way)
- Select your data: Click and drag your mouse to highlight the range of cells you want to format. If your data is already in a continuous block, you can simply click any single cell within that block.
- Convert to Table: Go to the Insert tab on the top 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?" Ensure the range is correct. If your data has headers (e.g., Name, Date, Amount), make sure the My table has headers checkbox is checked. Click OK.
- Apply Banded Rows: Once the table is created, a new tab called Table Design will appear in the ribbon. Ensure the Banded Rows checkbox is checked in the Table Style Options group.
- Choose the Gray Style: In the Table Styles gallery on the Table Design tab, click the dropdown arrow to see all available styles. Hover over the "Light" or "Medium" sections to find a style that uses gray alternating rows. Click the desired style to apply it.
Method 2: Using Conditional Formatting (The Custom Way)
Use this method if you do not want your data to be a formal "Table" (which adds filter buttons and specific sorting behaviors) but still want the alternating gray look.
- Select the Target Area: Highlight the cells, rows, or columns you want to format. You can select the entire worksheet by clicking 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.
- Use a Formula: In the New Formatting Rule dialog box, click the bottom option: Use a formula to determine which cells to format.
- Enter the Row Formula: 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 Gray Fill: Click the Format... button. In the Format Cells window, go to the Fill tab. Select a light gray color from the palette. Click OK to close the Format Cells window.
- Finalize the Rule: Click OK again on the New Formatting Rule window. Your selected range will now show alternating gray rows.
Method 3: Alternating Columns Instead of Rows
- Follow the same steps as Method 2, but instead of the row formula, use the column formula:
=MOD(COLUMN(),2)=0. - This will apply the gray fill to every even-numbered column (B, D, F, etc.) rather than the rows.
Common Mistakes
When attempting to shade every other cell, users often run into a few recurring pitfalls that can make the spreadsheet look messy or cause the formatting to break.
Manual Shading: The most common mistake is manually selecting every other row and clicking the paint bucket tool. While this works for five rows, it is unsustainable for hundreds. Furthermore, if you delete a row or insert a new one, the pattern is broken, and you have to manually re-shade the entire sheet to fix the gap.
Overlapping Rules: Applying a Table Style and then adding Conditional Formatting on top of it can create "fighting" colors. If you have a Table active, the Table Style usually takes precedence, or the Conditional Formatting may create strange patches of color. It is best to choose one method and stick to it.
Incorrect Formula Syntax: In the Conditional Formatting method, forgetting the equals sign at the start (=MOD...) or using a comma instead of a semicolon (depending on your regional Excel settings) will result in an error message stating the formula is invalid.
Selecting the Wrong Range: If you select a range that starts on an odd row (like Row 3) but use the =MOD(ROW(),2)=0 formula, the first row of your selection will be white and the second will be gray. If you want the very first row of your specific selection to be gray regardless of its actual row number in the sheet, you may need to adjust the formula to =MOD(ROW()-ROW($A$1),2)=0, replacing $A$1 with the top-left cell of your range.
Tips
To make your professional spreadsheets stand out, consider these advanced adjustments to your alternating gray cells:
Use "Very Light" Gray: High-contrast gray can be distracting and make the text harder to read. Use the lightest gray available in the theme colors palette. This provides a subtle guide for the eye without overwhelming the actual data.
Combine with Borders: Instead of heavy black borders around every cell, try using a white border on the gray rows. This creates a clean, modern "gridless" look that is common in high-end financial reports.
Dynamic Ranges: If you use the Table method (Ctrl + T), any new data you type directly below the last row will automatically be included in the table and will automatically receive the alternating gray shading. This saves you from having to re-apply formatting every time you add a new entry.
Freeze Panes: When using banded rows, it is highly recommended to freeze your top header row. Go to View > Freeze Panes > Freeze Top Row. This ensures that as you scroll down through your gray-and-white rows, you always know which column is which.
Troubleshooting
If your cells are not turning gray or the pattern looks incorrect, try these solutions in order of complexity:
Check for Existing Fill Colors: Conditional Formatting and Table Styles apply a layer of color, but if you have manually filled cells with a color (using the Fill Color tool), that manual color sometimes overrides the automatic shading. Select your data and set the Fill Color to "No Fill" to clear manual overrides.
Verify the Formula: If you used Method 2, go to Home > Conditional Formatting > Manage Rules. Check that the formula is exactly =MOD(ROW(),2)=0. Ensure there are no accidental spaces or missing parentheses. Also, check the "Applies to" range to ensure it covers the entire area you intended to shade.
Check Table Design Settings: If you converted your data to a Table but the colors aren't showing, go to the Table Design tab and ensure the Banded Rows box is actually checked. If it is checked and you still see no color, you may have selected a "None" or "Plain" table style from the gallery.
Refresh the Calculation: In very rare cases, Excel may not refresh the formatting immediately. Press F9 to recalculate the sheet or save and reopen the file to force the conditional formatting to trigger.
Frequently Asked Questions
Can I make every third row gray instead of every second?
Yes. In the Conditional Formatting formula, change the 2 to a 3: =MOD(ROW(),3)=0. This will apply the color to rows 3, 6, 9, and so on.
Will alternating colors print on my paper?
Yes, by default, these colors will print. If you want to avoid using too much ink, you can go to the Page Layout tab and check the Black and white box in the Sheet Options group before printing.
How do I remove the gray stripes?
If using a Table, go to Table Design and uncheck Banded Rows. If using Conditional Formatting, go to Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells.
Does this work in Google Sheets?
Yes, but the menu is different. In Google Sheets, you can simply go to Format > Alternating colors, which provides a dedicated sidebar for this exact purpose.
Can I use two different colors instead of gray and white?
Yes. Using Conditional Formatting, you can create two separate rules. Rule 1: =MOD(ROW(),2)=0 (set to light blue). Rule 2: =MOD(ROW(),2)=1 (set to light green). This will create a two-color alternating pattern.