Spread sheet formula for DMS and DD

froggy1

New Member
Joined
Jul 5, 2012
Messages
3
Hello,

This is my first time.
first of all, I am looking for a spread sheet formula to convert
for example 53°32'53" (this is how it is on the spread sheet already, I believe in text format), to decimal degrees.

Secondly I would like a spread sheet formula to convert for example 53.5517 decimal degrees to 53°33'06"

Thank you
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

sdruley

Well-known Member
Joined
Oct 3, 2010
Messages
557
Office Version
  1. 365
Platform
  1. Windows
function deg_to_dms ( degfloat )
Input must be non-negative: if degfloat < 0 error end if Compute degrees, minutes and seconds: deg ← integerpart ( degfloat ) minfloat ← 60 * ( degfloat - deg ) min ← integerpart ( minfloat ) secfloat ← 60 * ( minfloat - min ) Round seconds to desired accuracy: secfloat ← round( secfloat, digits ) After rounding, the seconds might become 60. These two if-tests are not necessary if no rounding is done. if secfloat = 60 min ← min + 1 secfloat ← 0 end if if min = 60 deg ← deg + 1 min ← 0 end if Return output: return ( deg, min, secfloatthis could be mend function

</pre>
ref
this function can be referred to within a cell
 

froggy1

New Member
Joined
Jul 5, 2012
Messages
3
I have found this formula, that works great, to convert deg min sec to decimal degrees when the number format is
53 32' 53"

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(A3)," ",":"),"'",""),CHAR(34),"")*24

what I am looking for is how should this formula be written to take into consideration the ° sign?
as in converting 53° 32' 53" to decimal degrees. Can it be done?
Any help would be appreciated!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,822
Messages
5,598,304
Members
414,224
Latest member
Crazy_FC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top