Professional Documents
Culture Documents
This article shows you how to automatically apply shading to every other row in a worksheet. You can apply the shading by using a simple conditional formatting formula. Alternatively, you can apply a predefined Excel table style to your data.
In this article
Technique 1: Apply shading to alternate rows by using conditional formatting Technique 2: Apply shading to alternate rows by using an Excel table style
2.
On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then click New Rule.
3.
In the New Formatting Rule dialog box, under Select a Rule Type, click Use a formula to determine which cells to format.
4.
In the Format values where this formula is true box, enter=MOD(ROW(),2)=0, as shown in the following illustration.
NOTE
enter =MOD(COLUMN(),2)=0 instead. 5. 6. 7. Click Format. In the Format Cells dialog box, click the Fill tab. Select the background or pattern color that you want to use for the shaded rows, and then click OK. At this point, the color you just selected should appear in the Preview window in the New Formatting Rule dialog box. 8. To apply the formatting to the cells on your worksheet, click OK
NOTE
To view or edit the conditional formatting rule, on the Home tab, in theStyles group, click the arrow next
If you find you want the table style without the table functionality, you can convert the table to a regular range of data. If you do this, however, you won't get the automatic banding as you add more data to your range. 1. 2. On the worksheet, select the range of cells that you want to format. On the Home tab, in the Styles group, click Format as Table.
3.
Under Light, Medium, or Dark, click the table style that you want to use.
TIP
Custom table styles are available under Custom after you create one or more of them. For information about
how to create a custom table style, see Format an Excel table. 4. In the Format as Table dialog box, click OK. Notice that the Banded Rows check box is selected by default in the Table Style Options group.
If you want to apply shading to alternate columns instead of alternate rows, you can clear this check box and select Banded Columns instead. 5. If you want to convert the Excel table back to a regular range of cells, click anywhere in the table to display the tools necessary for converting the table back to a range of data. 6. On the Design tab, in the Tools group, click Convert to Range.
TIP
You can also right-click the table, click Table, and then click Convert to Range.