Solved

Converting Decimal Degrees to D:M:S in excel Part 2

Posted on 2016-09-13
2
38 Views
Last Modified: 2016-09-13
This is a follow on qquestion from Converting Decimal Degrees to D:M:S in excel

There is a rounding error in The accepted solution

=CONCATENATE(TEXT(INT(ABS(A2)),"000"),":",TEXT(INT(ROUND(MOD(ABS(A2),1),2)*60),"00"),":",TEXT(ROUND(MOD(ROUND(MOD(ABS(A2),1),2)*60,1),2)*60,"00"),":",IF(A2<0,"S","N"),"/",TEXT(INT(ABS(J2)),"000"),":",TEXT(INT(ROUND(MOD(ABS(J2),1),2)*60),"00"),":",TEXT(ROUND(MOD(ROUND(MOD(ABS(J2),1),2)*60,1),2)*60,"00"),":",IF(J2<0,"W","E"))

Open in new window


Given these values in A2 & B2

78.004      123.997       I get  this 78:00:00:N/123:60:00:E

78.004      should be 78:00:14.4
123.997      should be 123:59:49.2


78:00:14:N/123:59:49:E

Any ideas how I amend the formula?
0
Comment
Question by:trevor1940
[X]
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
2 Comments
 
LVL 26

Accepted Solution

by:
Shaun Kline earned 500 total points
ID: 41796532
The ROUND function limits your numbers to 2 decimal places and is causing the inaccuracy. Change the round functions to use 3 decimal places to add precision.
Then change the TEXT function for the seconds part to output the values as 00.0.

Here is the updated function.

=CONCATENATE(TEXT(INT(ABS(A2)),"000"),":",TEXT(INT(ROUND(MOD(ABS(A2),1),3)*60),"00"),":",TEXT(ROUND(MOD(ROUND(MOD(ABS(A2),1),3)*60,1),3)*60,"00.0"),":",IF(A2<0,"S","N"),"/",TEXT(INT(ABS(J2)),"000"),":",TEXT(INT(ROUND(MOD(ABS(J2),1),3)*60),"00"),":",TEXT(ROUND(MOD(ROUND(MOD(ABS(J2),1),3)*60,1),3)*60,"00.0"),":",IF(J2<0,"W","E"))

Open in new window

0
 
LVL 1

Author Closing Comment

by:trevor1940
ID: 41796876
Thanx very much
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

630 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