Aug 11 2020 12:36 PM
I want to alternate the fill color as below without having to do it manually. I will often have thousands of lines and this can be tedious. Every time either the "Stop Name" or "Line" changes, I want it to change to either no fill or blue. The number of lines varies between 1 and 4. Any suggestions?
Robert Gauthier
Aug 11 2020 01:28 PM
SolutionSelect the range you want to format conditionally.
In the following, I'll assume that:
On the Home tab of the ribbon. select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=MOD(SUM(--(IF($A$3:$A3<>$A$2:$A2,1,0)+IF($B$3:$B3<>$B$2:$B2,1,0)>0)),2)=0
Click Format...
Activate the Fill tab.
Select the light blue fill color.
Click OK, then click OK again.
Warning: it might be slow.
Aug 11 2020 02:44 PM
Hi I tried out the solution you came up with but was unable to make it work... are you sure about it?
Aug 12 2020 01:06 AM
I have uploaded a small sample workbook: see https://www.dropbox.com/s/mddvsbdy2gjbmtm/CF2Columns.xlsx?dl=1
Aug 12 2020 05:08 AM
Aug 11 2020 01:28 PM
SolutionSelect the range you want to format conditionally.
In the following, I'll assume that:
On the Home tab of the ribbon. select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=MOD(SUM(--(IF($A$3:$A3<>$A$2:$A2,1,0)+IF($B$3:$B3<>$B$2:$B2,1,0)>0)),2)=0
Click Format...
Activate the Fill tab.
Select the light blue fill color.
Click OK, then click OK again.
Warning: it might be slow.