Convert and extract lat longs into separate fields

loto

New Member
Joined
Dec 17, 2011
Messages
11
Hi there,
I've extracted some lats and longs from Google and want to split them into separate cells and remove the degrees character and direction. Any idea how to do this in one go? e.g. I'd like to convert a whole load of lat/longs in one text string in a cell from this format to this:
e.g lat long cardiff
From:
51.4780° N, 3.1771° W
To:
51.4780,-3.1771
e.g.
lat long cape town
From:
33.9767° S, 18.4244° E
To:
-33.9767, 18.444

<colgroup><col></colgroup><tbody>
</tbody>



<tbody>
</tbody>
Any help as always would be much appreciated,
Thanks
Loto
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
With data in A1, in B1 enter:
=LEFT(A1,FIND(",",A1)-4)*IF(LEN(SUBSTITUTE(A1,"S",""))=LEN(A1),1,-1)
and in C1 enter:
=MID(A1,FIND(", ",A1)+2,FIND(", ",A1)-5)*IF(LEN(SUBSTITUTE(A1,"W",""))=LEN(A1),1,-1)

Thus if A1 contains:
51.4780° N, 3.1771° W

B1 will display
51.478
and C1 will display
-3.1771

<tbody>
</tbody>

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,337
Messages
6,130,106
Members
449,558
Latest member
andyamcconnell

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