bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Formatting > Conditional Formatting > Highlighting Cells Containing Specific Text

Highlighting Cells Containing Specific Text

Summary: If you want to highlight cells that contain certain characters, you can use the conditional formatting features of Excel to help out. Here’s how to set up the proper conditional format. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

You can use the conditional formatting feature in Excel to help draw attention to cells that contain specific text in which you are interested. For instance, if you have a range of cells and you want to know which ones contain the letters "shawn," then you can do the following in versions of Excel prior to Excel 2007:

  1. Select the range of cells.
  2. Choose Conditional Formatting from the Format menu. Excel displays the Conditional Formatting dialog box. (Click here to see a related figure.)
  3. In the drop-down Condition list, choose "Formula Is".
  4. In the formula box, enter the following formula. (Make sure you replace A1 with the cell address of the cell in the upper-left corner of the range selected in step 1.)
  5.      =NOT(ISERR(SEARCH("Shaw",A1)))
    
  6. Click on Format. Excel displays the Format Cells dialog box. (Click here to see a related figure.)
  7. Using the controls in the dialog box, specify a format that you want used for those cells that contain the specified text. For instance, you may want bold text in a red typeface.
  8. Click on OK to close the Format Cells dialog box.
  9. Click on OK to close the Conditional Formatting dialog box.

If you are using Excel 2007 then you should follow these steps, instead:

  1. Select the range of cells.
  2. With the Home tab of the ribbon displayed, click the Conditional Formatting option in the Styles group. Excel displays a palette of options related to conditional formatting.
  3. Choose Highlight Cells Rules and then choose More Rules from the resulting submenu. Excel displays the New Formatting Rule dialog box.
  4. In the Select a Rule Type area at the top of the dialog box, choose Use a Formula to Determine Which Cells to Format. (Click here to see a related figure.)
  5. In the Format Values Where This Formula Is True box, enter the following formula. (Make sure you replace A1 with the cell address of the cell in the upper-left corner of the range selected in step 1.)
  6. =NOT(ISERR(SEARCH("Shaw",A1)))
    
  7. Click Format to display the Format Cells dialog box.
  8. Using the controls in the dialog box, specify a format that you want used for those cells that contain the specified text. For instance, you may want bold text in a red typeface.
  9. Click OK to dismiss the Format Cells dialog box. The formatting you specified in step 7 should now appear in the preview area for the rule.
  10. Click OK.

You can make this approach even more general-purpose in nature by specifying a cell that contains what you want to search for. For instance, if you type "Shaw" in cell F7, then you could replace the formula in step 4 or step 5 with the following:

=NOT(ISERR(SEARCH($F$7,A1)))

Now, you can search for something different just by changing the characters in cell F7.

Tip #2671 applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007


Don't Go in Debt for Christmas! Tired of trying to keep up with the Joneses for Christmas? Want to enjoy the season rather than dread the aftermath? Learn how you can avoid the financial traps that spring up every Christmas.
 
Check out Top Fifteen Tips for Financing Christmas today!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)