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: Handling Validation for Proper Latitude.

Handling Validation for Proper Latitude

Written by Allen Wyatt (last updated March 25, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003


1

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. 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. Choose Validation from the Data menu. Excel displays the Data Validation dialog box.
  3. The Settings tab should be displayed. (See Figure 1.)
  4. Figure 1. The Settings tab of the Data Validation dialog box.

  5. Using the Allow drop-down list, choose Whole Number.
  6. In the Minimum and Maximum boxes enter 0 and 90, respectively.
  7. Adjust the settings on the other tabs of the dialog box, as desired.
  8. 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. Choose Validation from the Data menu. Excel displays the Data Validation dialog box.
  3. The Settings tab should be displayed.
  4. Using the Allow drop-down list, choose Whole Number.
  5. In the Minimum box enter 0.
  6. In the Maximum box enter =IF(A1=90,0,59).
  7. Adjust the settings on the other tabs of the dialog box, as desired.
  8. Click OK.

The formula used for the Maximum value (step 6) 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 (8232) 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: 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

Macro Runs Slowly, but Steps Quickly

When you have a macro that processes a huge amount of data, it can seem like it takes forever to finish up. These ...

Discover More

Adding AutoShapes

The graphics features of Excel allow you to add a number of predefined AutoShapes to a workbook. If you want to add ...

Discover More

Jumping to a Relative Line Number

As you navigate through a document, you may have a need to move forward or backward a specific number of lines. This is ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Specifying a Data Validation Error Message

Data validation is a great tool for limiting what can be input into a cell. Excel allows you to specify what should ...

Discover More

Single-Use Drop-Down List

Want to create an easy drop-down list? You can do so by using the data validation features of Excel.

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

2023-03-30 09:12:19

Mike J

Data validation for B1 is dependent on the value of A1, but A1 is also dependent on the value of B1.

This tip assumes that B1 is zero/blank when degrees are entered into A1. Enter a number > 1 into B1 and 90 will still be accepted in A1 (this could be edited after minutes are entered).

So data validation for A1 needs to be something like

Maximum =IF(B1>0,89,90)


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.