Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2019, and Excel in Microsoft 365. 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: Handling Validation for Proper Latitude.
Written by Allen Wyatt (last updated July 10, 2021)
This tip applies to Excel 2007, 2010, 2013, 2019, and Excel in Microsoft 365
Iswar has two cells in which users enter degrees and minutes, which represent latitude. The values can necessarily vary from 0 degrees and 0 minutes to 90 degrees and 0 minutes. (Obviously Iswar is dealing with northern-hemisphere latitudes.) He wants to use data validation to check and limit what can be entered in the two cells. For the degrees Iswar can validate that the value is between 0 and 90. The problem is with the minutes cell, which can vary from 0 to 59 unless the degrees cell is 90, then the only acceptable value is 0 minutes. Iswar wonders how he can create the validation for the minutes cell to take this into account.
Assuming that you enter degrees into cell A1, you could set up validation for the degrees in this manner:
Figure 1. The Settings tab of the Data Validation dialog box.
Now, assuming that you enter minutes into cell B1, you could set up validation for the minutes in this manner:
The formula used for the Maximum value (step 7) sets a maximum for the cell based on whatever is entered into cell A1 (the degrees).
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8235) applies to Microsoft Excel 2007, 2010, 2013, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Handling Validation for Proper Latitude.
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!
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 MoreData validation can be used to create lists of choices for entry into a particular cell. Using the techniques in this tip ...
Discover MoreWhen entering data in a worksheet, you may want to exercise some degree of control on the values that can be entered. ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments