Conditional Formatting for Partial Text Match in Excel (9 Examples)

Method 1 – Using ‘Text that Contains’ Option for Highlighting Partial Text Matches

In the sample dataset, we will highlight cells that contain the text Apple such as Pineapple, Sugar Apple, Rose Apple, and Custard Apple .

Excel conditional formatting partial text match

Steps:
 ➤ Select the range and go to the Home tab >> Styles Group >> Conditional Formatting Dropdown >> Highlight Cells Rules Option >> Text that Contains… Option.

Text that Contains Option

The Text That Contains dialog box will open.
➤ Enter apple in the first box and select the formatting style (here, Light Red Fill with Dark Red Text style has been selected) in the second box.
➤ Press OK.

Text that Contains Option

Conditional Formatting will be applied to the cells of the Item column having a partial match with Apple or apple.

Excel conditional formatting partial text match


Method 2 – Using SEARCH Function

 

Step 1:
➤ Select the range and go to the Home tab >> Styles Group >> Conditional Formatting Dropdown >> New Rule Option.

SEARCH function

The New Formatting Rule wizard will open.
➤ Select Use a formula to determine which cells to format and click on Format.

SEARCH function

The Format Cells dialog box will open.
➤ Select the Fill Option and choose any Background Color. Click OK.

SEARCH function

The New Formatting Rule dialog box will open.

Excel conditional formatting partial text match

Step 2:
➤ Add the following formula in the Format values where this formula is true box

=SEARCH("apple",$B4)>0

SEARCH will look for the portion apple in the cells of Column B and for finding any matches it will return a value which will be the starting position of the apple in the full text and so for finding the matches, it will return a value greater than 0.

➤ Press OK.

SEARCH function

The cells containing a partial match with Apple or apple will be highlighted.

Excel conditional formatting partial text match


Method 3 – Using SEARCH and ISNUMBER Functions

 

Steps:
➤ Follow Step 1 of Method 2.

SEARCH & ISNUMBER functions

➤ Add the following formula in the Format values where this formula is true box

=ISNUMBER(SEARCH("apple",$B4))

SEARCH will look for the portion apple in the cells of Column B and for finding any matches it will return a value which will be the starting position of the apple in the full text. And so ISNUMBER will return a TRUE if it gets any numeric value otherwise FALSE.

➤ Press OK.

SEARCH & ISNUMBER functions

Conditional Formatting will be applied to the cells that have a part of the whole text as Apple or apple.

SEARCH & ISNUMBER functions


Method 4 – Conditional Formatting for Case-Sensitive Partial Text Match Using FIND Function

Steps:
 ➤ Follow Step 1 of Method 2.

Case-Sensitive Partial Match

➤ Add the following formula in the Format values where this formula is true box

=FIND("Apple",$B4)

FIND will look for the portion Apple in the cells of Column B and for finding any matches it will return a value which will be the starting position of the Apple in the full text. For not matching with the cases of Apple properly, we will not get any value.

➤ Press OK.

Case-Sensitive Partial Match

The cells of the Item column having the texts Sugar Apple, Rose Apple and Custard Apple will be highlighted.

Excel conditional formatting partial text match


Method 5 – Using COUNTIF Function for Checking Partial Text Match

Steps:
➤ Follow Step 1 of Method 2.

COUNTIF Function

➤ Add the following formula in the Format values where this formula is true box

=COUNTIF($B4,"*apple*")

By using the wildcard symbol * before and after apple we are ensuring the partial matches here and COUNTIF will return the number of times this text portion appears in the cells of Column B.

➤ Press OK.

COUNTIF Function

Conditional Formatting will be applied to the cells having a portion of Apple or apple in the Item column.

Excel conditional formatting partial text match


Method 6 – Using Combination of COUNT and SEARCH Functions

 

Steps:
➤ Follow Step 1 of Method 2.

COUNT & SEARCH Functions

➤ Add the following formula in the Format values where this formula is true box

=COUNT(SEARCH("Apple",$B4))

SEARCH will look for the portion Apple in the cells of Column B and for finding any matches it will return a value which will be the starting position of the Apple in the full text. Then, COUNT will return 1 if it gets any number from the output of the SEARCH function otherwise 0.

➤ Press OK.

COUNT & SEARCH Functions

Conditional Formatting will be applied to the cells of the Item column that have a part Apple or apple of the whole text.

COUNT & SEARCH Functions


Method-7: Using Combination of IF and SEARCH Functions

Steps:
➤ Follow Step 1 of Method 2.

IF & SEARCH functions

➤ Add the following formula in the Format values where this formula is true box

=IF(SEARCH("apple",$B4),1,0)>0

SEARCH will look for the portion apple in the cells of Column B and for finding any matches it will return a value which will be the starting position of the apple in the full text. And then, IF will return 1 if SEARCH finds any matches otherwise 0 and for values greater than 0 finally, we will get TRUE otherwise FALSE.

➤ Press OK.

IF & SEARCH functions

The cells having a partial match with Apple or apple will be highlighted.

Excel conditional formatting partial text match


Method 8 – Conditional Formatting for Partial Text Match Using MATCH Function

Steps:
➤ Follow Step 1 of Method 2.

MATCH Function

➤ Add the following formula in the Format values where this formula is true box

=MATCH("*apple*",$B4,0)

By using the wildcard symbol * before and after apple we are ensuring the partial matches here and MATCH will return 1 for finding any partial matches in Column B.

➤ Press OK.

MATCH Function

Conditional Formatting will be applied to the cells having a portion of Apple or apple in the Item column.

Excel conditional formatting partial text match


Method 9 – Conditional Formatting for Multiple Partial Text Match Using Combined Formula

Steps:
➤ Follow Step 1 of Method 2.

Multiple partial matches

➤ Add the following formula in the Format values where this formula is true box

=IF(OR(ISNUMBER(SEARCH("apple", $B4)), ISNUMBER(SEARCH("berries", $B4))), "Yes", "")="Yes"
  • SEARCH(“apple”, $B4) → SEARCH will look for the portion apple in cell B4, and for finding any matches it will return a value which will be the starting position of the apple in the full text otherwise #N/A.
    Output → #N/A
  • ISNUMBER(SEARCH(“apple”, $B4)) becomes
    ISNUMBER(#N/A) → ISNUMBER will return TRUE for any numeric value otherwise FALSE.
    Output → FALSE
  • SEARCH(“berries”, $B4) → SEARCH will look for the portion berries in cell B4, and for finding any matches it will return a value which will be the starting position of the berries in the full text otherwise #N/A.
    Output → #N/A
  • ISNUMBER(SEARCH(“berries”, $B4)) becomes
    ISNUMBER(#N/A) → ISNUMBER will return TRUE for any numeric value otherwise FALSE.
    Output → FALSE
  • OR(ISNUMBER(SEARCH(“apple”, $B4)), ISNUMBER(SEARCH(“berries”, $B4))) becomes
    OR(FALSE, FALSE) → OR will return TRUE if any of the values are TRUE otherwise FALSE.
    Output → FALSE
  • IF(OR(ISNUMBER(SEARCH(“apple”, $B4)), ISNUMBER(SEARCH(“berries”, $B4))), “Yes”, “”) becomes
    IF(FALSE, “Yes”, “”) → IF will return yes for TRUE and a blank for FALSE.
    Output  Blank
  • IF(OR(ISNUMBER(SEARCH(“apple”, $B4)), ISNUMBER(SEARCH(“berries”, $B4))), “Yes”, “”)=”Yes” becomes
    “”=”Yes” → returns TRUE for matching the two values otherwise FALSE.
    Output → FALSE

➤ Press OK.

Multiple partial matches

The cells with partial matches with either apple or berries will be highlighted.

Multiple partial matches


Download Workbook


<< Go Back to Partial Match Excel | Formula List | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjima Hossain
Tanjima Hossain

TANJIMA HOSSAIN is a marine engineer who enjoys working with Excel and VBA programming. For her, programming is a handy, time-saving tool for managing data, files, and online tasks. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. She holds a B.Sc. in Naval Architecture & Marine Engineering from BUET and is now a content developer. In this role, she creates tech-focused content centred around Excel and VBA. Apart from... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo