Conditional Formatting based on names in a list AND.

amoverton2

Board Regular
Joined
May 13, 2021
Messages
77
Office Version
  1. 2016
Platform
  1. Windows
Aloha All,

So I found this thread: Conditional Formatting based on names in a list.

This works but I'd like to add to it. What about a name in a list and another cell that has anything in it (date, words, numbers, etc) that is directly to the right of it.

For example, based on my sheet, if I type any name in cells A2 thru A25 (or however long it may go), I want to conditional format if that name appears in the list of names from D2:D15 and if there is a date next to the name in the list from D2:D15 (in the normal spreadsheet the list of names in on another sheet but I condensed it down here to get the formula right) If that name is in the list but no date next to it, it will not conditional format.

My sheet below is with a formula I was playing around but it does not work because as you can see both Dan, Dexter, and Crystal are formatted but they do not have a date in the Date of Training column.

If this takes multiple columns or formulas I'm cool with that, as well as a macro. I appreciate the help, Mahalo!


Book1
ABCDE
1NameNameDate of Training
2PistolPistol1-Jun-21
3AdamPatrick2-Mar-21
4DanJoe3-Jun-21
5DexterDan
6JenBob18-Feb-21
7CrystalPhil21-Jan-21
8Carey7-Jun-21
9Lucy25-Mar-21
10Dexter
11Adam15-Apr-21
12Jen
13Mark8-May-21
14Matt8-May-21
15Crystal
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A25Expression=AND(COUNTIF(D2:D15,A2)>0,$E1<>"")textNO
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try it with
Excel Formula:
=COUNTIFS($D$2:$D$15,$A2,$E$2:$E$15,">0")
 
Upvote 0
Try changing your CF formula to
Excel Formula:
=AND(A2<>"",COUNTIFS($D$2:$D$15,A2,$E$2:$E$15,"<>"))
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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