Conditional format a cell based on the entry in another cell and also a dropdown...

charliew

Board Regular
Joined
Feb 20, 2018
Messages
71
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

Firstly I'm really sorry if this question has already been asked, i did have a really good rummage and couldn't find anything.

i have a column that I enter a code in (lets say E4), which is the one i want to conditional format.
I want this to be linked to a different cell that COULD have the word "keighley" in it (B1). IF the word "keighley" is in this cell i want this to trigger a list of acceptable codes (on a different sheet) and the the cell I enter the code in (E4) to highlight if not on the list...

Is this even possible?

Could anyone help me please?

Thank you

:):)
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
If I select E4 then Conditional Formatting with a rule "Use a formula to decide which cells to format" then I use:

=AND(($B$1="keighley"),(ISNA(MATCH($E$4,$G$1:$G$11,0))))

and select the Format required then it will only format E4 if B1="keighley" and the entry in E4 is not in the range of the MATCH.

I put the range to check on the same sheet but it works as well if on a different sheet. I always use an Excel table for a list source so it's dynamically maintained.

[TABLE="class: grid, width: 490"]
<colgroup><col><col span="3"><col><col><col></colgroup><tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B
[/TD]
[TD="align: center"]C
[/TD]
[TD="align: center"]D
[/TD]
[TD="align: center"]E
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]G
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]Keyword=
[/TD]
[TD="align: center"]keighley[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Valid Codes
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 1[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Enter Code[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 2[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 3[/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 3[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 4[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 5[/TD]
[/TR]
[TR]
[TD="align: center"]7
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 6[/TD]
[/TR]
[TR]
[TD="align: center"]8
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 7[/TD]
[/TR]
[TR]
[TD="align: center"]9
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 8[/TD]
[/TR]
[TR]
[TD="align: center"]10
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 9[/TD]
[/TR]
[TR]
[TD="align: center"]11
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]Code 10[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
For the same layout, here is another CF formula you could use.

Excel Workbook
ABCDEFG
1Keyword=keighleyValid Codes
2Code 1
3Enter CodeCode 2
4Code 300Code 3
5Code 4
6Code 5
7Code 6
8Code 7
9Code 8
10Code 9
11Code 10
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E41. / Formula is =AND($B$1="keighley",COUNTIF($G$2:$G$11,E4)=0)Abc
 
Last edited:
Upvote 0
This is absolutely perfect! thank you!! Can i add in =if(e4="","",AND(($B$1="keighley"),(ISNA(MATCH($E$4,$G$1:$G$11,0)))) ?????
 
Upvote 0
Does this do what you want?

=AND(E4<>"",$B$1="keighley",COUNTIF($G$2:$G$11,E4)=0)
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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