Help with conditional formatting formula containing text

barbilyn0875

New Member
Joined
Jul 28, 2011
Messages
3
Hi! I'm new here, and I need help with a formula to use with conditional formatting. What I want to accomplish is to search one column for certain text in a string, then format another column with a specific color if the formula brings back a TRUE result. Quick and dirty example

If cell B2 contains the text "AB", then I want to color cell D2 a certain color.

Any help is appreciated!

Thanks!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi
Welcome to the board

Select D2 and in the conditional formatting use the formula:

=$B$2="AB"

and set the format pattern
 
Upvote 0
That would work if the cell contained only that text, but I am searching for "AB" in a string of text. Any further suggestions?
 
Upvote 0
If that's the case use a formula that checks if "AB" is contained in the string in B2, for ex., in the conditional formatting of D2 use the formula:

=FIND("AB",$B$2)

Remark: Find() is case sensitive. Else use Search()
 
Upvote 0
pcg01,

Thanks for your quick reply. One more thing: I want to do this formatting all the way down the 2 columns, so I can't freeze the "AB" search to only one cell - it has to change to the next cell down each time.
 
Upvote 0
I'm not sure I understand exactly.

If you mean that D2 checks B2, D3 checks B3, etc., then don't freeze the row

In the conditional formatting of D2 use the formula:

=FIND("AB",$B2)

Copy the format down
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,473
Members
452,915
Latest member
hannnahheileen

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