Forum Discussion

SStrong1's avatar
SStrong1
Copper Contributor
Jul 31, 2024
Solved

Highlighting and grouping rows that share a value

I have a very large report that is distributed daily that requires thousands of rows of data that need to be reviewed. I'm trying to make it easier for the user to read the rows in groups by highlighting the alternate groups. Similar to when you use the Format as Table feature and every other row alternates color. But in this instance, I want to group a number of rows together in the same color based on a shared value and alternate the color for each grouped set of rows. Any idea on how to manage this and what conditional formatting formulas or other features I could use to accomplish this?

 

Example to keep it simple: if I wanted to alternate rows between different Objects in the below so that it would be grey for Apple, white for Orange and grey again for Watermelon, how would I do this:

AisleObjectAttribute
1AppleRed
1AppleRound
1AppleSmall
1OrangeOrange
1OrangeRound
1OrangeSmall
2WatermelonGreen
2WatermelonLarge

 

  • SStrong1 

    Select the rows starting from row 2 down. The active cell in the selection should be in row 2.

    On the Home tab of the ribbon, click Conditional Formatting > New Rule...
    Select 'Use a formula to determine which cells to format'.
    Enter the formula

    =ISODD(COUNTA(UNIQUE($B$2:$B2)))

    Click Format...
    Activate the Fill tab.
    Select grey as fill color.
    Click OK, then click OK again.

2 Replies

  • SStrong1 

    Select the rows starting from row 2 down. The active cell in the selection should be in row 2.

    On the Home tab of the ribbon, click Conditional Formatting > New Rule...
    Select 'Use a formula to determine which cells to format'.
    Enter the formula

    =ISODD(COUNTA(UNIQUE($B$2:$B2)))

    Click Format...
    Activate the Fill tab.
    Select grey as fill color.
    Click OK, then click OK again.

Resources