Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Limiting Entries to Numeric Values.
by Allen Wyatt
(last updated November 14, 2015)
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:
Figure 1. The Settings tab of the Data Validation dialog box.
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 (6263) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Limiting Entries to Numeric Values.
Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!
Want to control what users put into a cell? It's easy to do using a feature called data validation, as described in this tip.Discover More
Want to establish a "bottom limit" on what dates can be entered in a cell? This tip presents two different ways you can ...Discover More
When entering data in a worksheet, you may want to exercise some degree of control on the values that can be entered. ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.