Conditional Format Every Other Row in Excel

How-to basics · Updated November 22, 2026

Yes, you can conditionally format every other row in Excel by using the MOD function in a formula-based conditional formatting rule. Select your data range, go to Home > Conditional Formatting > New Rule > Use a formula, enter =MOD(ROW(),2)=0 for even rows (or =MOD(ROW(),2)=1 for odd rows), and set a fill color. This creates a static banded-row effect that updates automatically as you add or delete rows.

Why Use Conditional Formatting Instead of a Table Style

Excel’s built-in Table styles (Insert > Table) already apply banded rows by default, but they come with table behaviors like structured references and filter buttons. Conditional formatting gives you more control: you can apply banding to a specific range without converting it to a table, keep the data as a normal range, and combine the banding with other formatting rules. It also works when you want banding to start from a specific row, not necessarily row 1.

How the MOD Function Works for Row Banding

The formula =MOD(ROW(),2)=0 checks the remainder when the row number is divided by 2. If the remainder is 0, the row is even; if 1, it’s odd. For a range starting at row 1, this gives alternating rows. If your data starts at row 5, you need to adjust the formula to =MOD(ROW()-5,2)=0 so that the first row of your data is treated as “even” relative to your starting point. This works because ROW() returns the row number of the cell being evaluated in the conditional formatting rule.

Step-by-Step: Apply Banded Rows with Conditional Formatting

  1. Select the range you want to format (e.g., A2:F100).
  2. Go to Home > Conditional Formatting > New Rule.
  3. Choose “Use a formula to determine which cells to format”.
  4. In the formula box, enter =MOD(ROW(),2)=0 (or the adjusted version).
  5. Click Format, go to the Fill tab, pick a light color, and click OK.
  6. Click OK again to apply the rule.

On a Mac, the steps are identical except the ribbon is the same. In Excel for the web, conditional formatting formulas are supported, but you must use the “Custom formula is” option under the conditional formatting menu.

How to Make Banding Start at a Specific Row

If your data begins at row 3 (e.g., headers in rows 1-2), use =MOD(ROW()-3,2)=0. This subtracts the starting row number so that the first data row (row 3) returns 0, making it even. For example, if you have data in A3:C20, applying this formula will shade rows 3, 5, 7, etc. If you later insert a row above the range, the formula adjusts automatically because ROW() recalculates for each cell.

Combining Banding with Other Conditions

You can stack conditional formatting rules. For instance, to highlight every other row AND highlight cells with a value greater than 100 in yellow, create two rules: one for the banding (using MOD) and another for the highlight (using a formula like =A2>100). Order matters—Excel applies rules in order, and you can check “Stop If True” to prevent conflicts. For example, if you want the banding to be overridden by the highlight, put the highlight rule first and enable Stop If True.

Common Problems and Fixes

  • Banding not appearing: Check that the formula is entered without quotes and that the active cell’s row matches your expectation. Also, ensure the range is correct and the fill color is not white.
  • Banding shifts when sorting: Conditional formatting based on ROW() is static—it does not move with rows when you sort. If you need banding to follow data, use a helper column with a formula like =MOD(ROW(),2) and filter, or use a table style which re-bands after sorting.
  • Banding applies to entire rows instead of just the range: If you select entire columns (e.g., A:F), the rule will format every cell in those columns. To limit to used rows, select only the data range.
  • Performance issues on large sheets: Conditional formatting formulas are volatile if they use ROW()? Actually, ROW() is not volatile, but many rules can slow down Excel. For thousands of rows, consider using a table style instead.

Alternatives: Table Styles and VBA

If you don’t need custom conditions, the simplest alternative is to convert your data to a table (Ctrl+T on Windows, Cmd+T on Mac). Go to Table Design > Table Styles and check “Banded Rows”. This automatically applies alternating shading that adjusts when you add or delete rows. For more advanced automation, you can use a VBA macro to apply formatting, but that requires saving as a macro-enabled workbook and cannot be undone with Ctrl+Z. A simple macro example:

Sub BandRows()
    Dim rng As Range
    Set rng = Selection
    Dim i As Long
    For i = 1 To rng.Rows.Count
        If i Mod 2 = 0 Then
            rng.Rows(i).Interior.Color = RGB(242, 242, 242)
        End If
    Next i
End Sub

Remember to save a copy of your workbook before running any macro, as macros cannot be undone with Ctrl+Z.

Frequently Asked Questions

Does conditional formatting every other row work when I insert a new row?

Yes, because the formula uses ROW() which recalculates for each cell. If you insert a row within the formatted range, the new row will get the correct banding based on its new row number.

How do I format every other row but skip hidden rows?

Conditional formatting based on ROW() does not skip hidden rows—it formats based on row number, not visibility. To skip hidden rows, you would need to use a formula that checks if the row is visible, which is not straightforward. A workaround is to use a helper column with a formula like =SUBTOTAL(103,A2) and conditionally format based on that, but it’s complex.

Can I use ISEVEN instead of MOD?

Yes, =ISEVEN(ROW()) returns TRUE for even rows and FALSE for odd rows. It works exactly the same as =MOD(ROW(),2)=0. However, ISEVEN is not available in older Excel versions (pre-2007), so MOD is more compatible.

Why does my banding start on the wrong row?

Because ROW() returns the actual row number. If your data starts at row 2, you need to subtract 2 (or 1) to make the first row even. Adjust the formula to =MOD(ROW()-2,2)=0 to start banding at row 2.

Can I apply banding to columns instead of rows?

Yes, replace ROW() with COLUMN() and use =MOD(COLUMN(),2)=0 to band every other column. The same principles apply.

Does conditional formatting work in Google Sheets?

Yes, Google Sheets has a similar feature: Format > Conditional formatting > Custom formula is, and you can use =MOD(ROW(),2)=0 with the range applied. The syntax is identical, but the menu path differs.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.