Forum Discussion
Conditional formatting based on 2 columns of text.
- Aug 11, 2020
Select the range you want to format conditionally.
In the following, I'll assume that:
- The range begins in row 3.
- The active cell in the selection is in row 3.
- The Stop Name and Line columns are column A and B, respectively.
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.
Select the range you want to format conditionally.
In the following, I'll assume that:
- The range begins in row 3.
- The active cell in the selection is in row 3.
- The Stop Name and Line columns are column A and B, respectively.
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.
- PoogermumAug 11, 2020Brass Contributor
Hi I tried out the solution you came up with but was unable to make it work... are you sure about it?
- HansVogelaarAug 12, 2020MVP
I have uploaded a small sample workbook: see https://www.dropbox.com/s/mddvsbdy2gjbmtm/CF2Columns.xlsx?dl=1
- Robert1967Aug 12, 2020Copper Contributor