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

Tips.Net > ExcelTips Home > Data Entry > Data Validation > Limiting Entries to Numeric Values

Limiting Entries to Numeric Values

Summary: When creating a worksheet, you may need to limit what can be entered into a particular cell. Using data validation you can easily limit input to numeric values within a certain range. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

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 if you are using a version of Excel prior to Excel 2007:

  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. (Click here to see a related figure.)
  3. 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.
  4. Using the Data drop-down list, make sure Between is selected.
  5. Enter in the Minimum and Maximum boxes the lower and upper bounds of what you want users to enter in the cell.
  6. On the other tabs of the dialog box, enter an input message and an error message, if desired.
  7. Click OK.

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

  1. Select the cell you want used for inputting a value.
  2. Display the Data tab of the ribbon.
  3. In the Data Tools group, click the Data Validation tool. Excel displays 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. Enter in the Minimum and Maximum boxes 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.

Tip #2425 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.)