How To: Automatically color alternating rows in Excel

Automatically color alternating rows in Excel

This video is a tutorial on using the Conditional Formatting function of Excel to automatically color alternating rows, which helps your eye to follow across the row. This can be done manually with the “Fill Color” button, but if you add or delete rows after applying the shading, the whole purpose is defeated.

There is an easy way to format a range of cells so that alternating rows are automatically colored, and the shading adjusts when cells are added or deleted. This works the same way in Excel 2007 and earlier versions, with slight differences.

In Excel 2003, select the cells where you want to apply the shading. Go to the “Format” menu and select “Conditional Formatting”. In the drop-down menu select “Formula Is” and type in “=mod(row(), 2)”. (This formula works by combining two different functions, and is explained in detail at the end of the video.) When the conditions of the formatting are true, the formatting is applied. Click on “Format” and change the background pattern, click OK, and the alternating rows are now colored. The formatting can easily be changed or removed, and you can also apply it to columns rather than rows.

In Excel 2007, select the range of cells, making sure you are in the “Home” menu. The “Conditional Formatting” command is in the “Styles” section. Select “New Rule”, then select “Use a formula to determine which cells to format”. In the formula box type the formula as before, select your formatting and click OK. You can go back to the “Conditional Formatting” command if you want to clear the formatting from selected cells or the entire sheet, or you can change the formatting or the formula with the “Manage Rules” command.

Want to master Microsoft Excel and take your work-from-home job prospects to the next level? Jump-start your career with our Premium A-to-Z Microsoft Excel Training Bundle from the new Gadget Hacks Shop and get lifetime access to more than 40 hours of Basic to Advanced instruction on functions, formula, tools, and more.

Buy Now (97% off) >

Other worthwhile deals to check out:

Join the Next Reality AR Community

Get the latest in AR — delivered straight to your inbox.

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest