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

charliew

Board Regular
Joined
Feb 20, 2018
Messages
68
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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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.

A
B
C
D
E
F
G
1
Keyword=
keighleyValid Codes
2
Code 1
3
Enter CodeCode 2
4
Code 3Code 3
5
Code 4
6
Code 5
7
Code 6
8
Code 7
9
Code 8
10
Code 9
11
Code 10

<colgroup><col><col span="3"><col><col><col></colgroup><tbody>
</tbody>
 
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,214,591
Messages
6,120,431
Members
448,961
Latest member
nzskater

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