In the example shown, the formula used to highlight every 3 rows in the table is: Where 3 is n (the number of rows to group) and 4 is an offset to normalize the first row to 1, as explained below. In this case, the first row of data is in row 5, so we use an offset of 4: The result goes into the CEILING function, which rounds incoming values up to a given multiple of n. Essentially, the CEILING function counts by a given multiple of n:

This count is then divided by n to count by groups of n, starting with 1:

Finally, the ISEVEN function is used to force a TRUE result for all even row groups, which triggers the conditional formatting. Odd row groups return FALSE so no conditional formatting is applied.

Shade first group

To shade rows starting with the the first group of n rows, instead of the second, replace ISEVEN with ISODD:

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.