Conditional Formatting - Multiple Criteria

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
594
Office Version
  1. 365
I need a table to highlight the cells from C to J IF Cell D contains "Lee" and any cell from E to J Contains "Yes".

So for instance


.C.. | . D . |. E . |. F . |. G . |. H . |

Lee | YES | YES | YES | YES | YES | (All row should be highlighted)
--------------------------
Lee | YES | YES | | | | Cells C to E should be highlighted only in row)
--------------------------
Rik | | | | | | (Nothing should be highlighted)
--------------------------
Lee | YES | YES | YES | YES | | (Cells C to G should be highlighted)


Hope that makes sense!!
------------
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Not 100% clear. Which cells should be highlighted in this case?


Book1
CDEFGHIJ
1LeeYESYESYESYESYESYES
2LeeYESYES
3RikYES
4LeeYESYESNOYES
5Lee
Sheet1


WBD
 
Last edited:
Upvote 0
Hi
Row 1 C, D,E,F,G,H,I
Row 2 C,D,E
Row 3 - (None)
Row 4 - C, D, F,H

(Cells D: J will only either be Yes or left blank, and all will be in a row, there wont be gaps between the Yeses)


Not 100% clear. Which cells should be highlighted in this case?

CDEFGHIJ
LeeYESYESYESYESYESYES
LeeYESYES
RikYES
LeeYESYESNOYES
Lee

<colgroup><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1



WBD
 
Upvote 0
OK. Highlight column C and add a new conditional format based on the following formula:

Code:
=AND($C1="Lee",$D1="YES")

Now highlight columns D:J and add another conditional format based on the following formula:

Code:
=AND($C1="Lee",D1="YES")

Note the use of the $ to anchor the columns and the fact that it's missing from the second part of the second formula. Make sure both conditions use the same format.

WBD
 
Upvote 0
Works like a charm! Many thanks :)

OK. Highlight column C and add a new conditional format based on the following formula:

Code:
=AND($C1="Lee",$D1="YES")

Now highlight columns D:J and add another conditional format based on the following formula:

Code:
=AND($C1="Lee",D1="YES")

Note the use of the $ to anchor the columns and the fact that it's missing from the second part of the second formula. Make sure both conditions use the same format.

WBD
 
Upvote 0

Forum statistics

Threads
1,223,728
Messages
6,174,157
Members
452,548
Latest member
Enice Anaelle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top