Excel.Tips.Net Welcome toExcel.Tips.Net

Helpful Links

Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment

Tips.Net Store

ExcelTips FAQ
ExcelTips Premium

Learn Access Now
Free Printable Forms

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

Advertise on the
ExcelTips Site

Newest Tips

Recording a Macro

Adding a Little Animation to Your Life

Converting a Range of URLs to Hyperlinks

Making the Formula Bar Persistent

Engineering Calculations

Digital Signatures for Macros

Fixing the Decimal Point

 

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.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2671) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

A Picture is Worth Thousands! Your worksheets are not limited to holding numbers and text. You can also add graphics or easily create charts based on your data. Excel Graphics and Charts, available in two versions, helps you make your graphics and charts their absolute best.
 
Check out Excel Graphics and Charts today!