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.

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:

  1. Select cell A1.
  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. The Settings tab should be displayed. (See Figure 1.)
  5. Figure 1. The Settings tab of the Data Validation dialog box.

  6. Using the Allow drop-down list, choose Whole Number.
  7. In the Minimum and Maximum boxes enter 0 and 90, respectively.
  8. Adjust the settings on the other tabs of the dialog box, as desired.
  9. Click OK.

Now, assuming that you enter minutes into cell B1, you could set up validation for the minutes in this manner:

  1. Select cell B1.
  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. The Settings tab should be displayed.
  5. Using the Allow drop-down list, choose Whole Number.
  6. In the Minimum box enter 0.
  7. In the Maximum box enter =IF(A1=90,0,59).
  8. Adjust the settings on the other tabs of the dialog box, as desired.
  9. Click OK.

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.

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

Locking Callouts to a Graph Location

If you add callouts using the drawing tools in Excel, you may have noticed that they don't always stay where you expect ...

Discover More

Returning Zero When a Referenced Cell is Blank

Reference a cell in a macro, and if that cell is blank Excel normally equates that to a zero value. What if you don't ...

Discover More

Enhancing Word Documents with Dynamic Fields (Table of Contents)

Add a field to your document and you add dynamic content. Word provides a wide variety of fields that can be used in a ...

Discover More

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!

More ExcelTips (ribbon)

Adding Pop-Up Documentation to a Cell

Want to have a small help screen pop up when a user selects a particular cell? This can be done by using data validation, ...

Discover More

Limiting Choices in a Cell

Want to limit what a person can enter into a particular cell? You can use Excel's data validation feature to help enforce ...

Discover More

Limiting Input to Two Decimal Places

When entering data in a worksheet, you may want to exercise some degree of control on the values that can be entered. ...

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 four minus 0?

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 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.

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.