totn Excel

MS Excel 2003: Automatically alternate row colors (two shaded, two white)

This Excel tutorial explains how to use conditional formatting to automatically alternate row colors, two shaded and two white, in Excel 2003 and older versions (with screenshots and step-by-step instructions).

Question: How can I set up alternating row colors in Microsoft Excel 2003/XP/2000/97? I want to alternate between 2 shaded rows and 2 white rows.

Answer: To do this, first highlight the rows that you wish to apply the formatting to. In this example, we've selected all rows in the spreadsheet.

Microsoft Excel

Under the Format menu, select Conditional Formatting.

Microsoft Excel

When the Conditional Formatting window appears, select "Formula Is" in the drop down. Then enter the following formula that uses the MOD, TRUNC and ROW functions:

=MOD(TRUNC((ROW()+1)/2),2)=1

You may need to adjust the ROW()+1 to ROW() depending on which row you want to see shaded first.

Next, we need to select the color we want to see in the shaded rows. To do this, click on the Format button.

Microsoft Excel

When the Format Cells window appears, select the Patterns tab. Then select the color that you'd like to see. In this example, we've selected a light orange. Then click on the OK button.

Microsoft Excel

When you return to the Conditional Formatting window, you should see the following. Next, click on the OK button.

Microsoft Excel

Now when you return to the spreadsheet, the conditional formatting will be applied.

As you can see, you now have alternating colors - 2 shaded rows followed by 2 white rows. You can insert, delete, and move rows, and you don't have to worry about reapplying formatting.

Microsoft Excel