Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 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: Exporting Latitude and Longitude.
by Allen Wyatt
(last updated June 8, 2019)
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:
Figure 1. The Number tab of the Format Cells dialog box.
Now you should be able to save the file in text format, and the latitudes and longitudes will look as expected:
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:
Figure 2. The Paste Special dialog box.
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 (8393) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Exporting Latitude and Longitude.
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!
If you work with geographic data, you may need a way to display latitude and longitude in a worksheet. This tip examines ...Discover More
If you want information to display on the screen using fractions instead of decimals, you're in luck. Excel provides ...Discover More
Cell contents and cell formatting are, in Excel, largely independent of each other. You can enter something in a cell and ...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.