Conditional Formatting - Multiple Criteria

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
597
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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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