I have a list of data and I want to be able to toggle between highlighting one subset to highlighting another subset. Is there a way to toggle between highlighting subset A to highlighting subset B?
CodePudding user response:
A Data Validation and Conditional Formatting Combination
- Select cell
A2
. SelectData > Data Validation > Data Validation
and underAllow:
chooseList
and underSource:
input1;2
. - Select range
C2:H11
. SelectHome > Conditional Formatting > New Rule
and selectUse a formula to determine which cells to format
and in the text box below add the following formula:
=OR(AND($A$2=1,ISNUMBER(MATCH(C2,$J$2:$J$6,0))),AND($A$2=2,ISNUMBER(MATCH(C2,$K$2:$K$6,0))))
and select OK
and OK
.
- If you select
1
in cellA2
the numbers from theJ
column are highlighted, and if you select2
, the numbers from theK
column are highlighted.