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: Limiting Entries to Numeric Values.

Limiting Entries to Numeric Values

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


1

Gary has a worksheet that people in his office use for data entry. He wants to make sure that in a particular cell they can only enter a numeric value. He wonders how to stop them from entering other entries—like text or dates or times—in the cell.

The easiest way to do this is to use Excel's data validation feature. This feature allows you to define the parameters of what can be entered in a cell. Follow these steps:

  1. Select the cell you want used for inputting a value.
  2. Choose Validation from the Data menu. Excel displays the Settings tab of the Data Validation dialog box. (See Figure 1.)
  3. Figure 1. The Settings tab of the Data Validation dialog box.

  4. Using the Allow drop-down list, choose either Whole Number or Decimal, depending on which type of numeric input you want to allow. Excel changes the controls available in the dialog box.
  5. Using the Data drop-down list, make sure Between is selected.
  6. In the Minimum and Maximum boxes, enter the lower and upper bounds of what you want users to enter in the cell.
  7. On the other tabs of the dialog box, enter an input message and an error message, if desired.
  8. Click OK.

People can now enter only a numeric value within the range you specified. The one exception to this is dates and times. Since they are maintained internally, by Excel, as numbers, it is possible to enter a date, provided the date is parsed into a numeric value that is within the range you specify.

For instance, if you set up data validation to only allow values between 20,000 and 21,000, then someone could enter a date of 6/11/1956 because Excel parses the date to the whole number 20,617. The best way to handle dates and times is to format the cell so that it uses a numeric format, which will stop Excel from displaying dates and times.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2425) 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: Limiting Entries to Numeric Values.

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

Hiding Errors

If you find the green and red squiggly underlines that Word adds to your document distracting, you might want a quick way ...

Discover More

Status Bar Summing No Longer Available

When you select a range of cells, Excel normally displays the sum of those selected cells on the status bar. If the sum ...

Discover More

Progression Indicator in a Macro

When your macro is humming along, minding its own business, a user watching the screen may not see any activity and ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (menu)

Ensuring Unique Values in a Column

If you want to make sure that only unique values are entered in a particular column, you can use the data validation ...

Discover More

Limiting Input to a Format

When setting up a worksheet for others to use, you might want to make some limitations on what can be entered in certain ...

Discover More

Stopping Validated Data from being Overwritten

Data Validation is a great tool to make sure that data entered in a cell meets whatever criteria you decide. Its ...

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 8 - 5?

2022-01-25 13:33:32

Adrian

Thank you, very very much and have nice days


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.