ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   conditional formatting (https://www.excelbanter.com/excel-worksheet-functions/179991-conditional-formatting.html)

casey

conditional formatting
 
Thanks to Conan for answering my first similar question!
I now have a follow-up question.

Consider this data:

Col A Col B Col C Col D
Row 1 family_b bob family_b art
Row 2 jim family_b bob
Row 3 kirk family_d will
Row 4 greg family_e sam

1) If "bob" in Col B is found in Col D AND "family_b" ($A$1 a constant) is
NOT found in Col C, then "bob" in Col B turns blue.

OR

2) If "bob" in Col B is found in Col D AND "family_b" ($A$1 a constant) IS
found in Col C then "bob" in Col B turns red.

I can accomplish either #1 or #2 separately. But i can't seem to put both
together.

("bob" in Col B will turn red in above data. If I remove "family_b" from
Col C then "bob" in Col B would turn blue. $A$1 will change with manual
input to a different "family_x".)

Thanks,
casey

Tom Hutchins

conditional formatting
 
You will need two 'Formula Is' conditions. For the RED condition (Condition
1), enter
=SUMPRODUCT(--($D$1:$D$4=B1),--($C$1:$C$4=$A$1))0

Click the Add button to add another condition (Condition 2). For the BLUE
condition, enter
=SUMPRODUCT(--($D$1:$D$4=B1),--($C$1:$C$4<$A$1))0

Hope this helps,

Hutch

"casey" wrote:

Thanks to Conan for answering my first similar question!
I now have a follow-up question.

Consider this data:

Col A Col B Col C Col D
Row 1 family_b bob family_b art
Row 2 jim family_b bob
Row 3 kirk family_d will
Row 4 greg family_e sam

1) If "bob" in Col B is found in Col D AND "family_b" ($A$1 a constant) is
NOT found in Col C, then "bob" in Col B turns blue.

OR

2) If "bob" in Col B is found in Col D AND "family_b" ($A$1 a constant) IS
found in Col C then "bob" in Col B turns red.

I can accomplish either #1 or #2 separately. But i can't seem to put both
together.

("bob" in Col B will turn red in above data. If I remove "family_b" from
Col C then "bob" in Col B would turn blue. $A$1 will change with manual
input to a different "family_x".)

Thanks,
casey


casey

conditional formatting
 
Thanks, Hutch! Works perfectly!

"Tom Hutchins" wrote:

You will need two 'Formula Is' conditions. For the RED condition (Condition
1), enter
=SUMPRODUCT(--($D$1:$D$4=B1),--($C$1:$C$4=$A$1))0

Click the Add button to add another condition (Condition 2). For the BLUE
condition, enter
=SUMPRODUCT(--($D$1:$D$4=B1),--($C$1:$C$4<$A$1))0

Hope this helps,

Hutch

"casey" wrote:

Thanks to Conan for answering my first similar question!
I now have a follow-up question.

Consider this data:

Col A Col B Col C Col D
Row 1 family_b bob family_b art
Row 2 jim family_b bob
Row 3 kirk family_d will
Row 4 greg family_e sam

1) If "bob" in Col B is found in Col D AND "family_b" ($A$1 a constant) is
NOT found in Col C, then "bob" in Col B turns blue.

OR

2) If "bob" in Col B is found in Col D AND "family_b" ($A$1 a constant) IS
found in Col C then "bob" in Col B turns red.

I can accomplish either #1 or #2 separately. But i can't seem to put both
together.

("bob" in Col B will turn red in above data. If I remove "family_b" from
Col C then "bob" in Col B would turn blue. $A$1 will change with manual
input to a different "family_x".)

Thanks,
casey



All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com