Conditional Formatting if another cell contains specific text

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
567
Office Version
  1. 365
Platform
  1. Windows
I am trying to highlight text in a cell if cell M4 contains the text "OFF"

I tried this but its highlighting regardless if the cell contains "OFF" or not.

=ISNUMBER(SEARCH("OFF",$M4))

Thanks
James
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Works fine for me, try again in a new clean sheet or workbook.
 
Upvote 0
If "off" is not there I want the font to say black. But it changes to red every time. ????
 
Upvote 0
i used your formula
and applied to the range starting at M2


Book11
M
2
3
4off
5m-off-1
6
7
8off
9m-off-1
10
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M2:M17Expression=ISNUMBER(SEARCH("OFF",$M2))textYES
 
Upvote 0
FWIW you do not need that ISNUMBER function in your Conditional Formatting (though it shouldn't hurt).
As I understand the requirement, this is what you want. You existing formula, or this shorter one should do the same job.

23 12 01.xlsm
ABCDEFGHIJKLM
1Hdr1Hdr2Hdr3Hdr4Hdr5Hdr6Hdr7Hdr8Hdr9Hdr10Hdr11Hdr12Hdr13
2datadatadatadatadatadatadatadatadatadatadatadataOFF
3datadatadatadatadatadatadatadatadatadatadatadataON
4datadatadatadatadatadatadatadatadatadatadatadataNeither
5datadatadatadatadatadatadatadatadatadatadatadata
6datadatadatadatadatadatadatadatadatadatadatadataOFF
7datadatadatadatadatadatadatadatadatadatadatadatanew office chair
CF OFF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:M7Expression=SEARCH("OFF",$M2)textNO
 
Upvote 0

Forum statistics

Threads
1,215,077
Messages
6,122,995
Members
449,094
Latest member
masterms

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