Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Conditional Format that Checks for Data Type.

Conditional Format that Checks for Data Type

Written by Allen Wyatt (last updated January 4, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


Joshua is trying to establish a conditional format that will alert a user that text data has been entered into a cell intended for numerical data or when numerical data has been input into a cell intended for text data.

A conditional format can be used to draw attention to when an improper value (text or numeric) has been entered in a cell, but a more robust approach might be to prohibit the improper value from being entered in the first place. This can be done with the data validation capabilities of Excel. These capabilities have been discussed, in detail, in other ExcelTips; more information can be found here:

http://excel.tips.net/E165_Data_Validation.html

Using data validation, you can specify the type and range of data permitted in a cell, along with how stringently you want that specification followed. If you prefer to not use data validation for some reason, you could set up a conditional format that would verify if the information placed in a cell is of the data type you want. Follow these steps:

  1. Select the cells that you want conditionally formatted.
  2. Choose Conditional Formatting from the Format menu. Excel displays the Conditional Formatting dialog box.
  3. In the drop-down Condition list, choose "Formula Is". (See Figure 1.)
  4. Figure 1. The Conditional Formatting dialog box.

  5. In the formula box, enter the one of the following formulas. (The first is if you want to highlight the cell if it contains text; the second if it contains a number. 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.      =ISTEXT(A1)
         =ISNUMBER(A1)
    
  7. Click on Format. Excel displays the Format Cells dialog box.
  8. Using the controls in the dialog box, specify a format that you want used for those cells selected in step 1. For instance, you may want bold text in a red typeface.
  9. Click on OK to close the Format Cells dialog box.
  10. Click on OK to close the Conditional Formatting dialog box.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6906) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Conditional Format that Checks for Data Type.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Unwanted Styles

Want to get rid of some styles in a document that you don't need any more? It can be a difficult thing to do, unless you ...

Discover More

Determining Word Frequency

How to construct a word frequency list.

Discover More

Running a Procedure when a Workbook is Opened

Ever want to have Excel run a procedure whenever you open a workbook? It's not as difficult as you might think. Here's how.

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (menu)

Noting Inactivity within a Timeframe

There are many times when you are creating a worksheet that you need to analyze dates within that worksheet. Once such ...

Discover More

Understanding Conditional Formatting Conditions

Conditional formatting can be a great way to highlight specific information in your worksheets. This tip explains the ...

Discover More

Detecting Errors in Conditional Formatting Formulas

If an error exists in a formula tucked inside a conditional format, you may never know it is there. There are ways to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 4?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.