Pages

Highlighting alternative rows or columns in tables

Highlighting alternative rows or columns in tables
From time to time we have to present data in large tables and it might not be easy to read if the background color is the same for all rows or columns. Excel conditional formatting can be a tremendous help to make data tables less monotonous by changing background colors of alternative rows or columns. Of course you can paint the rows or columns yourself, but what about it you need to add a column or a row in the between?
Well, the trick to overcome this problem lies in Conditional Formatting.

And here is how to do it:
  • The 1st first step is to select the part of the table that you want to format.
  • Go to Conditional formatting dialog (Home Tab > Conditional Formatting > New Rule).
  • Select the last line "Use a formula to determine which cells to format".
  • Now, if you want to highlight alternative columns, enter the following formula, =MOD(COLUMN();2)=1
    which means, whenever row() of the current cell is even, to change the coloring to odd rows, you just need to put =MOD(COLUMN();2)=0 as formula
  • Click the "Format" button to format the columns as you like (I have used green color). The final result should look like this:
Highlighting alternative rows or columns in tables
  • Click OK.
  • Job Done

There are endless possibilites:
  • In case you want to highlight alternative rows instead of columns, just use row() instead of column() formula.
  • Now, lets imagine that you want to have switch background colors of every 4rd collumn instead, just use =MOD(COLUMN();4)=1. Your imagination is the limit.

No comments:

Post a Comment