Text within string, within a formula for conditional formatting

MissH

New Member
Joined
Jul 4, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
How can set up a rule in conditional formatting that is looking to a cell to contain text as opposed to equal text? e.g., If the cell ="apple", I can use =$A2="apple". BUT, if I want the rule to based on text within a string, eg, to format based on "apple pie", "apple tart", "baked apples", how do I do that? Can conditional formatting cope with find() or search(), and if so how to use it correctly?
I was hoping to use =A2=ISNUMBER(SEARCH("apple",$A2,1)) but that didn't work.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Thank you. I appreciate the help. That works to be able to highlight the individual cells.
My issue now is trying to apply formatting to the whole row based on the one cell, and the only way I know how to do that is to put in the extra "A2=", but maybe that isn't going to work here. Any tips to get the whole row formatted? If not, at least I have the one cell highlighted which is workable, so thank you.
 
Upvote 0
Try using
Excel Formula:
=ISNUMBER(SEARCH("apple",A2,1))
Note: Cell A2 should be the upper-left corner of the conditionally-formatted range.
 
Upvote 0
Welcome to the MrExcel board!

Not that important but you should not need the ISNUMBER function in your conditional formatting formula. Does this do what you want?

24 07 05.xlsm
ABCD
1Textdata 1data 2data 3
2apple66439
3cherry145746
4apple tart763910
5baked apples589133
6peach909660
7peach pie591082
8pineapple63806
9banana286245
10apricot632310
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D10Expression=SEARCH("apple",$A2)textNO
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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