ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Data tools
  3. How to Shade Alternate Row Colors in Excel

How to Shade Alternate Row Colors in Excel

By ExcelReady Team·Updated November 3, 2026·5 min read

The short answer

The quickest way to shade alternate rows in Excel is to turn the data into a table with Ctrl+T (Mac: ⌘T), which adds banded rows automatically. For a normal range, select it, go to Home > Conditional Formatting > New Rule, choose "Use a formula", type =MOD(ROW(),2)=0 and pick a fill color. The bands stay correct when you sort.

Key takeaways

  • Ctrl+T (Mac: ⌘T) turns data into a table with banded rows in one step.
  • For a normal range, use the conditional formatting formula =MOD(ROW(),2)=0, or =ISEVEN(ROW()).
  • =MOD(INT((ROW()-2)/3),2)=0 shades bands of three rows, starting from row 2.
  • =MOD(SUBTOTAL(3,$A$2:$A2),2)=0 keeps the stripes even when rows are filtered out.
  • Don't stripe by hand with fill color: the colors move with the data when you sort.
On this page+
  1. Why shade alternate rows?
  2. Method 1: Format as a table (the fastest way)
  3. Method 2: Conditional formatting with MOD and ROW
  4. Shade bands of several rows or every nth row
  5. Keep the stripes when you filter
  6. Shade rows by group instead of by count
  7. Edit or remove alternate row shading
  8. Practise it

To add alternate row colors in Excel, press Ctrl+T (Mac: ⌘T) to turn your data into a table, which shades every other row for you. If you'd rather keep a normal range, add a conditional formatting rule with the formula =MOD(ROW(),2)=0. Both stay correct when you sort or add rows. This guide covers both methods, plus bands of several rows, columns, filtered lists and how to remove the shading.

Why shade alternate rows?#

Banded rows, also called zebra stripes, help the eye follow a row across a wide table. They make it easier to read the right number in long lists, printed reports and screen shares.

Avoid painting the stripes by hand with the Fill Color button. Manual colors belong to the cells, so when you sort, filter or insert a row, the pattern breaks. Both methods below calculate the stripes, so they always line up.

Method 1: Format as a table (the fastest way)#

A table adds banded rows in one step.

  1. Click any cell inside your data.
  2. Press Ctrl+T (Mac: ⌘T), or go to Home > Format as Table and pick a style.
  3. Check that My table has headers is ticked and click OK.

Excel shades every other row. To change the look, click inside the table and use the Table Design tab:

  • Table Styles: pick another color scheme.
  • Banded Rows: tick or untick the stripes.
  • Banded Columns: shade every other column instead, or as well.

Tables also grow when you add rows at the bottom, and the stripes follow. The guide to Excel tables and Ctrl+T covers the other benefits, such as formulas that fill down by themselves.

If you need a plain range again, use Table Design > Convert to Range. The colors stay, but they become fixed formatting, so they won't adjust when you sort or insert rows.

Method 2: Conditional formatting with MOD and ROW#

A conditional formatting rule shades rows on any range, without making a table. It's the method to use when a table isn't allowed or when you need a custom pattern.

  1. Select the data rows, for example A2:E50 (leave out the header).
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose Use a formula to determine which cells to format.
  4. Type this formula:
Excel formula
=MOD(ROW(),2)=0
  1. Click Format, open the Fill tab, pick a light color and click OK twice.

Every even row is now shaded: rows 2, 4, 6 and so on.

How it works: ROW() returns the row number of each cell, and MOD(number,2) returns the remainder after dividing by 2. Even rows have a remainder of 0, so the rule is TRUE and Excel applies the fill. For row 4, MOD(4,2) is 0; for row 5, it's 1. The MOD and INT guide explains MOD in more detail.

To shade the odd rows instead, use =MOD(ROW(),2)=1. The shorter =ISEVEN(ROW()) and =ISODD(ROW()) work too.

Shade bands of several rows or every nth row#

You can change the pattern by changing the maths.

PatternFormulaRows shaded (data starting in row 2)
Every other row=MOD(ROW(),2)=02, 4, 6, 8 …
Every third row=MOD(ROW(),3)=03, 6, 9 …
Bands of 3 rows=MOD(INT((ROW()-2)/3),2)=02–4, 8–10, 14–16 …
Every other column=MOD(COLUMN(),2)=0Columns B, D, F …

The bands formula works in three steps. ROW()-2 makes the first data row count as 0. Dividing by 3 and taking the INT gives the same number for each group of three rows: 0 for rows 2 to 4, 1 for rows 5 to 7. Then MOD checks whether that group number is even. Change both 2s if your data starts on a different row, and the 3 for a different band size.

Keep the stripes when you filter#

The ROW-based rule uses real row numbers, so when a filter hides rows, two shaded or two plain rows can end up next to each other. To stripe only the visible rows, use SUBTOTAL:

Excel formula
=MOD(SUBTOTAL(3,$A$2:$A2),2)=0
  • SUBTOTAL(3,…) is COUNTA that ignores rows hidden by a filter.
  • $A$2:$A2 grows one row at a time as the rule moves down. The first $A$2 is locked and the second $A2 has an unlocked row, so in row 10 it reads $A$2:$A10.
  • The count goes 1, 2, 3 … down the visible rows, and MOD shades every second one.

Column A must have a value in every row for the count to be right. Use an ID or name column that is never blank.

Shade rows by group instead of by count#

Sometimes you want the color to switch when a value changes, such as each new date or customer. A helper column makes this easy. With the group in column A and data from row 2:

  1. In F2, type 1.
  2. In F3, type =IF(A3=A2,F2,1-F2) and fill down.
  3. Add a conditional formatting rule on A2:E50 with =$F2=1.

The helper flips between 1 and 0 each time column A changes, and the rule shades every row where it's 1. The data must be sorted by the group column. The $ before F keeps every cell in the row looking at column F, the same trick used to highlight a whole row based on one cell.

Edit or remove alternate row shading#

To change a conditional formatting rule, select a cell in the range and go to Home > Conditional Formatting > Manage Rules. There you can edit the formula, the color or the Applies to range.

To remove the shading:

  • Rule: select the range and choose Conditional Formatting > Clear Rules > Clear Rules from Selected Cells, or from Entire Sheet.
  • Table: untick Banded Rows on the Table Design tab, or pick the None style at the top-left of the style gallery.

If your rule doesn't work, check three things: the formula starts with =, the Applies to range starts on the row you expect, and no other rule with a different fill is above it in the list. The guides to conditional formatting with formulas and conditional formatting basics cover rule order and more examples.

Practise it#

Banding is one formula rule, and the same skill colors whole rows by status, date or value. Practise conditional formatting in a live spreadsheet: you highlight values, duplicates and the top 3, then color whole rows with a formula rule. Then practise more formatting to tidy number and date styles. Try the exercise on this page to see exactly what the banding rule returns for a row.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Conditional formatting shades a row when its rule returns TRUE. Click E4 and type the banding rule =MOD(ROW(),2)=0 to see what Excel checks for row 4, then press Enter.

fx
ABCDEF
1
Order
Customer
Amount
2
SO-201
Patel
320
3
SO-202
Okafor
145
4
SO-203
Lindqvist
610
Shade row 4?
5
SO-204
Moreau
88
6
SO-205
Tanaka
275
7
8
9

Tip: ROW() gives the row number of the cell the formula is in. MOD(…,2) is 0 for even rows.

Practise this in a lesson

LessonConditional formattingMake important numbers stand out: highlight values over a limit, duplicate IDs and the top 3, then color whole rows with a formula rule and a $ on the column.LessonMore formattingItalic and underline, comma style, date format, and resetting a cell to General.

Frequently asked questions

How do I make every other row a different color in Excel?

+

Select the data, press Ctrl+T (Mac: ⌘T) and click OK to make a table, which shades alternate rows. Or use Home > Conditional Formatting > New Rule > Use a formula, type =MOD(ROW(),2)=0 and choose a fill color.

How do I alternate row colors without a table?

+

Use conditional formatting with a formula. Select the range, choose New Rule > Use a formula to determine which cells to format, type =MOD(ROW(),2)=0 and set a fill color. It works on any normal range.

How do I keep alternate row colors when filtering?

+

Use the rule =MOD(SUBTOTAL(3,$A$2:$A2),2)=0 instead of the ROW version. SUBTOTAL counts only visible rows, so the stripes alternate on what you can see. Column A must have a value in every row.

How do I remove alternate row shading in Excel?

+

For a table, untick Banded Rows on the Table Design tab or choose the None style. For a conditional formatting rule, select the range and use Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells.

How do I shade every third row in Excel?

+

Use the conditional formatting formula =MOD(ROW(),3)=0. It shades rows 3, 6, 9 and so on. Change the 3 to shade every nth row.

Sources

  • Use conditional formatting to highlight information - Microsoft Support
  • Create and format tables - Microsoft Support
  • MOD function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why shade alternate rows?
  2. Method 1: Format as a table (the fastest way)
  3. Method 2: Conditional formatting with MOD and ROW
  4. Shade bands of several rows or every nth row
  5. Keep the stripes when you filter
  6. Shade rows by group instead of by count
  7. Edit or remove alternate row shading
  8. Practise it

Keep reading

Data tools· 5 min read

Conditional Formatting With a Formula in Excel

To use a conditional formatting formula in Excel, select the cells, go to Home > Conditional Formatting > New Rule and choose Use a formula to determine which cells to format. Type a formula that returns TRUE or FALSE for the top-left cell, such as =$E2>5, and pick a format. Excel colours every cell where the formula is TRUE.

Data tools· 6 min read

Excel Tables (Ctrl+T): Why and How to Use Them

An Excel table is a list that Excel manages for you. Click any cell in your data, press Ctrl+T (⌘T on a Mac), check "My table has headers" and click OK. You instantly get filter buttons, banded rows and an optional total row, and formulas, charts and pivot tables that use the table grow when you add rows.

Data tools· 5 min read

Highlight an Entire Row Based on a Cell Value

To highlight a row based on a cell value, select the whole table without the header, such as A2:E9, then go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Type =$D2="Late", choose a fill colour. The $ locks column D, so each row checks its own status.

More on data tools

  • Excel Area Chart: When to Use One and How to Build It
  • How to Make a Bar Chart in Excel
  • Make a Box and Whisker Plot in Excel
  • How to Make a Bubble Chart in Excel With Three Measures
  • How to Change the Axis Scale on an Excel Chart
  • Make an Excel Chart Ignore Blank Cells and Zeros
All data tools articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free