Alternating Colours in Excel: The Best Easy Methods
In this article
To create alternating colours in Excel, the fastest method is to convert your data range into a Table by pressing Ctrl + T and ensuring the "Banded Rows" option is checked. This automatically applies a professional, alternating colour scheme that persists even when you sort, filter, or add new rows of data. This technique, often called "zebra striping," improves readability by helping the eye track a single row across multiple columns without getting lost.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A dataset consisting of at least two columns and several rows of data.
- Basic knowledge of how to select a range of cells.
Step-by-Step
Depending on your goals, there are two primary ways to achieve this effect: using the Table feature for speed and automation, or using Conditional Formatting for complete custom control. Note that menu labels may differ slightly depending on your version of Excel or regional settings.
Method 1: Using Excel Tables (The Fastest Way)
- Select your data: Click and drag your mouse to highlight the entire range of cells you want to format. Alternatively, click any single cell within your data set and press Ctrl + A (Windows) or Cmd + A (Mac) to select the current region.
- Convert to Table: Go to the Insert tab on the top ribbon and click the Table button. You can also use the keyboard shortcut Ctrl + T.
- 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 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. Click this tab to see the "Table Styles" gallery.
- Apply Banded Rows: In the Table Design tab, look for the "Table Style Options" group. Ensure the Banded Rows checkbox is ticked. You can also tick Banded Columns if you prefer vertical alternating colours.
- Change Colours: To change the specific colours used, browse the Table Styles gallery. Hover over the different presets to see a live preview on your sheet, then click the one that fits your project.
Method 2: Using Conditional Formatting (The Custom Way)
Use this method if you cannot convert your data into a formal table or if you need a specific pattern (like every third row being coloured).
- Select the range: Highlight the cells you want to format. Avoid selecting the header row if you want the alternating pattern to start specifically on the first row of actual data.
- Open Conditional Formatting: On the Home tab, click Conditional Formatting in the Styles group, then select New Rule... from the dropdown menu.
- Use a Formula: In the New Formatting Rule dialog, select the option "Use a formula to determine which cells to format."
- Enter the Formula: In the formula box, type the following:
=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 Format: Click the Format... button. Go to the Fill tab and select the background colour you want for your alternating rows. Click OK.
- Finalize: Click OK again to close the New Formatting Rule window. Your selected range will now have alternating colours based on whether the row index is even or odd.
Common Mistakes
One of the most frequent errors is manually shading rows using the Fill Bucket tool. While this works for small lists, it is a major mistake for larger datasets because the colours remain static. If you sort your data or insert a new row, the alternating pattern will break, leaving you with two rows of the same colour next to each other. This requires tedious manual correction.
Another common mistake is applying Conditional Formatting to the entire worksheet (by clicking the top-left corner triangle) instead of a specific range. This can significantly slow down your workbook's performance because Excel has to calculate the MOD formula for millions of empty cells. Always limit your formatting to the actual data area.
Users also frequently forget to check the "My table has headers" box when creating a table. If this is missed, Excel will treat your first row of labels as a data row, which can throw off the alignment of your alternating colours and make your headers look like part of the list.
Tips
For a more professional look, avoid using high-contrast, bright colours like neon yellow or deep red. Instead, use very light greys or pale blues. This ensures that the black text remains easy to read and the spreadsheet doesn't look cluttered or distracting during a presentation.
If you want to change the pattern to every third row instead of every second, you can modify the Conditional Formatting formula. Change =MOD(ROW(),2)=0 to =MOD(ROW(),3)=0. This is particularly useful for complex reports where data is grouped in threes.
To quickly remove all alternating colours from a Table, go to the Table Design tab and select the first option in the Table Styles gallery (usually labeled "None" or "Light"), or simply uncheck the Banded Rows box. This returns the cells to a standard white background without deleting your data.
Troubleshooting
The colours aren't appearing: If you used Conditional Formatting and the colours aren't showing, check that you haven't already applied a manual fill colour to those cells. Manual formatting often overrides conditional formatting. Select the cells and set the Fill colour to "No Fill" to let the rule take over.
The pattern is shifted: If your alternating colours start on the wrong row (e.g., you want the first row to be white but it is coloured), change the formula from =MOD(ROW(),2)=0 to =MOD(ROW(),2)=1. This switches the logic from even rows to odd rows.
The table styles aren't updating: If you change a Table Style but the colours don't change, ensure that you haven't manually coloured individual cells within the table. Manual overrides are "sticky" and will ignore the Table Style settings. To fix this, select the table, go to the Home tab, and select "No Fill."
The formula is giving an error: Ensure you are using a comma as the separator in the MOD function. In some European regions, Excel uses a semicolon (;) instead of a comma (,). If you see a formula error, try =MOD(ROW();2)=0.
Frequently Asked Questions
Can I use alternating colours in Excel Online?
Yes, the Table method (Insert > Table) works exactly the same in the web version of Excel. Conditional Formatting is also supported, though the interface may look slightly different than the desktop application.
Will alternating colours print correctly?
Yes, they will. However, if you are using very light shades, ensure your printer settings are not set to "Draft" or "Ink Saver" mode, as this can sometimes make very pale grey bands disappear entirely.
Does converting to a table change my data?
Converting to a table does not change the values in your cells, but it does add filtering arrows to your headers and enables special table features like structured references. You can always convert it back to a normal range by going to Table Design > Convert to Range.
Can I alternate colours by column instead of row?
Yes. In a Table, simply check the "Banded Columns" box in the Table Design tab. If using Conditional Formatting, change the formula from ROW() to COLUMN(), like this: =MOD(COLUMN(),2)=0.
Why is my table not automatically adding colours to new rows?
This usually happens if you are typing data outside the boundaries of the official Table range. Ensure you are typing directly below the last row of the table; Excel should automatically expand the table boundary and apply the alternating colour to the new row.