Extracting Minutes From Coordinates (D-M-S)

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,570
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Consider these two georgraphic co-ordinates

Book3
BCDEFGHI
42N56°51'50.2"W101°04'31.2"N56510.0
43N50°00'47"W110°47'57"N5000.0
Table046 (Page 19)
Cell Formulas
RangeFormula
F42:F43F42=LEFT([@Column2],1)
G42:G43G42=VALUE(MID([@Column2],2,2))
H42:H43H42=VALUE(MID([@Column2],5,2))
I42:I43I42=IF(LEN(B42=10),0,VALUE(MID(B42,8,4)))


I am trying to extract the seconds values of these co-ordinates. Lets consider we're tring to extract the Longitudinal minutes from column B (in text) to column I (in decimal). You will notice that the data in column C is inconsistent. In my dataset, in column c, there are several values that do not have decimal second values as in C43 (47"), unlike the majority of data that does have a decimal seconds value like in C42 (50.2").

My formula in column I is failing. I am getting a value of all zeros, which is correct for that source data without decimal seconds (length of value in C = 10), however, the other values in C (whose length = 12) do not produce the desired result. In the illustrated case I am looking for a numeric value of 50.2. Column I is formatted as a number to one decimal place.

Can someone point out to me where the error in my formula is (column I)? Should I be going about this with a different approach perhaps?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
That was a silly mistake. Tank you for not making me feel foolish.
I'm surprised it didn't throw an error.
 
Upvote 0
Here's an array option.
Book1
BCDEFGH
42N56°51'50.2"W101°04'31.2"N565150.2
43N50°00'47"W110°47'57"N500047
Sheet4
Cell Formulas
RangeFormula
E42:H43E42=TEXTSPLIT(REPLACE(B42,2,0,"|"),{"|","°","'",""""},,1)
Dynamic array formulas.
 
Upvote 0
Here's an array option.
.. but it doesn't produce the results that the OP seems to want in row 43 going by their attempted formula in post 1 and the marked solution in post 2.
(Though the apparent expected result doesn't make sense to me :confused: - and your results do. :))

(Your formula also will not work in the OP's layout, which is a formal Excel table.)
 
Last edited:
Upvote 0
.. but it doesn't produce the results that the OP seems to want in row 43 going by their attempted formula in post 1 and the marked solution in post 2.
(Though the apparent expected result doesn't make sense to me :confused: - and your results do. :))

(Your formula also will not work in the OP's layout, which is a formal Excel table.)
Can you explain why it wouldn't work? Do you mean the output range is a table? If so, then yes it won't work with spill range.
Book1
BCDEFGH
41Coord1Coord2
42N56°51'50.2"W101°04'31.2"N565150.2
43N50°00'47"W110°47'57"N500047
Sheet4
Cell Formulas
RangeFormula
E42:H43E42=TEXTSPLIT(REPLACE(Table1[@Coord1],2,0,"|"),{"|","°","'",""""},,1)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,871
Messages
6,175,092
Members
452,612
Latest member
MESTeacher

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
Back
Top