Excel.Tips.Net Welcome toExcel.Tips.Net

Helpful Links

Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment

Tips.Net Store

ExcelTips FAQ
ExcelTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

Newest Tips

Recording a Macro

Adding a Little Animation to Your Life

Converting a Range of URLs to Hyperlinks

Making the Formula Bar Persistent

Engineering Calculations

Digital Signatures for Macros

Fixing the Decimal Point

 

Shading Rows with Conditional Formatting

Summary: If you need to shade alternating rows in a data table, you'll want to examine how you can accomplish the task with conditional formatting. This tip shows just how easy such shading can be. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

If you haven't tried out the conditional formatting features of Excel before, they can be quite handy. One way to use this feature is to cause Excel to shade every other row in a table. This is great when you have a particularly wide table, and you want to make it a bit easier to read on printouts. Simply follow these steps if you are using Excel 2007:

  1. Select the table whose alternate rows you want to shade.
  2. Make sure the Home tab of the ribbon is displayed.
  3. Click the Conditional Formatting tool. Excel displays a series of choices.
  4. Click New Rule. Excel displays the New Formatting Rule dialog box.
  5. In the Select a Rule Type area at the top of the dialog box, choose Use a Formula to Determine Which Cells to Format. (Click here to see a related figure.)
  6. In the formula space, enter the following formula:
  7. =MOD(ROW(),2)=0
    
  8. Click on the Format button. Excel displays the Format Cells dialog box.
  9. Make sure the Fill tab is selected. (Click here to see a related figure.)
  10. Select the color you want used for the row shading.
  11. Click on OK to close the Format Cells dialog box.
  12. Click on OK to close the New Formatting Rule dialog box.

Those familiar with Excel 2007 may wonder why anyone would use conditional formatting to highlight different rows of a table when you can use the table formatting feature (available in the Styles group of the Home tab of the ribbon) to accomplish the same thing. The reason is simple—using conditional formatting provides much more flexibility in the formatting applied as well as in the interval of the rows being shaded.

If you are using an older version of Excel then there is no style to provide alternate-row formatting, so you must use conditional formatting. Follow these steps:

  1. Select the table whose alternate rows you want to shade.
  2. Choose Conditional Formatting from the Format menu. Excel displays the Conditional Formatting dialog box.
  3. Using the pull-down condition, select Formula Is. Excel changes the dialog box controls to reflect your choice. (Click here to see a related figure.)
  4. In the formula box, enter the following:
  5.      =MOD(ROW(),2)=0
    
  6. Click on the Format button. Excel displays the Format Cells dialog box.
  7. Make sure the Patterns tab is selected. (Click here to see a related figure.)
  8. Select the color you want used for the row shading.
  9. Click on OK to close the Format Cells dialog box.
  10. Click on OK to close the Conditional Formatting dialog box.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2799) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

Remove Some Stress at Tax Time! Doing your personal income taxes can be a royal pain. Why not make the process just a bit less stressful with our 101-question checklist. You can prepare for filing your taxes with confidence, knowing you've covered all your bases.
 
Check out Filing Your Income Taxes Checklist today!