Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Converting Decimal Degrees to D:M:S in excel

Posted on 2016-09-07
Medium Priority
Last Modified: 2016-09-09
Can someone explain why I'm getting rounding errors in the attached spread sheet?  DDtoDMS.xlsx

I'm expecting column 'T' to look like this


Open in new window

If E3 =0.55 and F3 = "E3*60"/33 so how can G3 = "INT(F3)" / 32?

My maths might be dodgy but 0.55 *60 = 33

Also how do I fix the leading zeros in the output?
Question by:trevor1940
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 33

Expert Comment

by:Rob Henson
ID: 41788098
That is bizarre to say the least!!

If you copy E2 and paste values elsewhere, it gives 0.549999999999997 hence why that value multiplied by 60 doesn't give an exact 33.

Change the formula in E2 to:


That sorts it.

I don't see any leading zeros in the output.

Rob H
LVL 33

Expert Comment

by:Rob Henson
ID: 41788120
To force the numbers to show as a certain number of digits, you can use the TEXT function, your end result formula becomes:


Change the number of 0 in the " " to affect how the number appears.
LVL 33

Accepted Solution

Rob Henson earned 1600 total points
ID: 41788168
Alternatively, this formula gives the same result but without using helper columns, ie just using Decimal Degrees and Hemisphere columns (A & B and J & K):


In addition, your Hemisphere calculations can be simpler:

North/South =IF(A2<0,"S","N")
East/West =IF(J2<0,"W","E")

That could even be incorporated into the main formula so just using the Decimal Degrees in columns A & J:



EDITED 17:31: To correct missing ABS statements

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 22

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 400 total points
ID: 41788283
Looking at formula in K:
use the ROUND function on values in column I and R. Internally, Excel is storing values as double-precision data type, which is stored in exponential format and therefore, not precise. Any calculation made should be rounded to the desired precision as that is not implicitly determined by the factors.

Author Comment

ID: 41788339
Hi Rob

If you copy E2 and paste values elsewhere, it gives 0.549999999999997 hence why that value multiplied by 60 doesn't give an exact 33.

Change the formula in E2 to:


Any idea why this happening?

Thanx for your 1 cell solution very neat I had opened up my solution to work where this error was

BTW Latitude can only be 2 digits for degrees only saying


use the ROUND function on values in column I and R. Internally,

How will that help?  hasn't the damage already been made at this point?

I don't understand how 42.55 - 42 doesn't = 0.55?  is there a format setting some where causing this error?
LVL 33

Expert Comment

by:Rob Henson
ID: 41789688
Crystal has answered the question as why Excel is doing this, much as it is annoying I don't think there is a lot that can be done about it other than allowing for it with ROUND functions.

Author Closing Comment

ID: 41790802
Thanx for you help and explanation

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question