Shading alternate rows in a large spreadsheet can improve legibility. Excel’s Conditional Formatting feature allows you to apply cell shading to every other row in a worksheet range using the Modulus (=mod) function.
- Select the range of cells or rows or columns to format.
- Click Conditional Formatting from the Styles group on the Home tab of the Ribbon. Select New Rule…
- The New Formatting Rule dialog box displays. Select Use a formula to determine which cells to format.
- Enter =MOD(ROW(),2)=0 in the Format values where this formula is true: field under Edit the Rule Description:
- Click the Format… button. The Format Cells dialog box displays. Select the Fill tab to specify a color for the shaded rows. Click the OK button.
- Note: Choose a light color to ensure enough contrast between text color and row shading.
- The New Formatting Rule window displays with selected color in Preview: area. Click the OK button.
- Alternating rows are formatted in the selected color.
- Note: To update color
- Select the range of cells.
- Select Conditional Formatting from the Styles group on the Home tab of the Ribbon. Select Manage Rules…
- The Conditional Formatting Rules Manager window displays with rules for the Current Selection listed.
- Select the Formula:=MOD(ROWS…0). Click the Edit Rule… button.
- The Edit Formatting Rule window displays. Click the Format button
. - The Format Cells widows displays. Select a different color for row shading. Click OK
.
- Note: To update color