Excel.Tips.Net ExcelTips (Menu Interface)

Exporting Latitude and Longitude

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: Exporting Latitude and Longitude.

Deidre uses an Excel worksheet to store latitude and longitude values. These values are entered in cells in the format 26:05:35, which Excel interprets as hours, minutes, and seconds. Internally, Excel converts the entry into an internal date value. This means that the value is stored internally as the serial number 1.08721064814815, but is displayed, automatically, in the elapsed time format.

Deidre is running into a problem when she tries to use the data in the worksheet with a different program that needs the latitude and longitudes values in text format. In other words, she needs them in a text file in the format 26:05:35, not in some other date/time representation that may be picked by Excel.

The first thing to try is to select all the cells that contain latitudes and longitudes, and make sure they are formatted properly. Follow these steps:

  1. Select all the cells.
  2. Choose Cells from the Format menu. Excel displays the Format Cells dialog box.
  3. Make sure the Number tab is displayed. (See Figure 1.)
  4. Figure 1. The Format Cells dialog box.

  5. Make sure that Time is selected in the Category list.
  6. Make sure that 37:30:55 is selected in the Type list. (This is the elapsed time format.)
  7. Click on OK.

Now you should be able to save the file in text format, and the latitudes and longitudes will look as expected:

  1. Save your workbook in regular Excel format.
  2. Choose Save As from the File menu. Excel displays the Save As dialog box.
  3. Using the Save As Type drop-down list, indicate that you want to save the worksheet as Text (Tab Delimited).
  4. Use the other controls in the dialog box to specify a location and file name for the text file.
  5. Click on Save. Excel reminds you that you will lose formatting and some features by saving the file in text format. That's OK; it is the reason you saved the file in Excel format in step 1.

When done, you should be able to open the Excel-created text file and see that it contains the latitudes and longitudes in the format wanted. If it doesn't (for some bizarre reason), then you should try the following:

  1. Insert an empty column to the right of your latitudes or longitudes. (In this example, I assume that the latitudes or longitudes are in column A, and you insert a blank column at B.)
  2. In the cell to the right of the first latitude or longitude (assume that value is in A3, so you would choose B3), enter the following formula:
  3.      =TEXT(A3,"[h]:mm:ss")
  4. Copy the formula down to all the other cells that need converting.
  5. Select all the formulaic cells in column B.
  6. Press Ctrl+C to copy them all to the Clipboard.
  7. Select cell A3.
  8. Choose Paste Special from the Edit menu. Excel displays the Paste Special dialog box. (See Figure 2.)
  9. Figure 2. The Paste Special dialog box.

  10. Make sure the Values option is selected.
  11. Click on OK. Excel pastes just the values—the text values—into the original cells.
  12. Delete column B.

The formula used in step 2 probably bears some explanation. It takes the value in A3 (the date serial value) and formats it as elapsed time, but as text. This is the format in which you ultimately want the values. You should now be able to save your worksheet as a text file (use the steps provided earlier in this tip), and the latitudes and longitudes should be formatted as expected.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2770) 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: Exporting Latitude and Longitude.

Related Tips:

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 5+3 (To prevent automated submissions and spam.)
           Commenting Terms

Comments for this tip:

Michael Hasney    09 Dec 2014, 06:00
Why not enter an apostrophe prior to the numbers? Excell recognises this as text.
Similarly regarding one from a couple of weeks ago about changing the cell colour to Red, Green and blank.
If the formula in A2 is =IF(B2<=30,"Go","Stop")
and conditional formatting is used Condition 1 is if Cell value equal to "Go" then Format Patterns Green and condition 2 "Stop" will be red.

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.