Search This Blog

Tuesday 16 April 2013

Conditional Formatting on a filtered table every Nth rows

Dear All,

Sometimes happens that we have to format a filtered table, with one or more filters applied and every Nth rows.

In this situation it would be nice if the formatting could change automatically and accordingly with our filters. Unlikely, the solution it might not be so straight forward due to the non hidden rows.

The first approach could be to use the well known formula below, changing the MOD function to much our Nth rows:

=MOD(ROW(),2)=1

but unfortunately this formula is not working on a filtered table due to the hidden rows.

Changing the formula as:

=MOD(SUBTOTAL(3,$B$6:$B$110)-SUBTOTAL(3,$B8:$B$110),5)=4

where B8:B112 is our range of data [please change it accordingly with your data].
In the example above the conditional formatting is applied every 5 rows.

Please find below a more fancy solution with custom Nth rows: https://docs.google.com/file/d/0B2P1gDTiLkkSY3Npay1tN1dZMnM/edit?usp=sharing

Best,

Paolo

No comments: