+ Reply to Thread
Results 1 to 4 of 4

Sort by Latitude and Longitude

  1. #1
    Registered User
    Join Date
    11-30-2020
    Location
    Decatur, AL
    MS-Off Ver
    Windows 10
    Posts
    2

    Sort by Latitude and Longitude

    I am trying to sort a very large set of data by latitude and longitude to find out which locations are closest together but I have not found an effective way for me to do this.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Sort by Latitude and Longitude

    You appear to be storing the lat/long as text rather than numbers.

    There are various ways to convert them to numbers, here's one:

    1. Copy a blank cell.
    2. Select all the latitude and longitude values.
    3. Goto Paste>Paste Special... and select Add from the Operation section
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-30-2020
    Location
    Decatur, AL
    MS-Off Ver
    Windows 10
    Posts
    2

    Re: Sort by Latitude and Longitude

    Right, but whenever I change this, is there a formula that I can use to be able to calculate the distance from a starting point in order to sort all of these?

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,611

    Re: Sort by Latitude and Longitude

    As the Location ID's would represent points then I would think we could utilize the Pythagorean theorem to find the relative distance between them.
    In the attached file I put the following in cell D2 and copied down: =SQRT(SUM((B3-B$2)^2,(C3-C$2) ^2))
    Next I selected A2:D6751 and sorted column D from least to greatest (leaving Location 410020 as the starting point)
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sort database based on longitude and latitude
    By Aleksander1989 in forum Access Tables & Databases
    Replies: 3
    Last Post: 11-16-2018, 12:30 PM
  2. Latitude/longitude computation?
    By Hambone70 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-27-2014, 12:30 PM
  3. Latitude & Longitude processing help please
    By Pilot_Greg in forum Excel General
    Replies: 11
    Last Post: 12-14-2009, 03:31 PM
  4. MGRS to Longitude/Latitude
    By ajocius in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2009, 11:26 AM
  5. Latitude/Longitude Porblem
    By edwardtong694 in forum Excel General
    Replies: 3
    Last Post: 05-20-2009, 12:23 PM
  6. [SOLVED] formula for longitude/latitude
    By Leo in forum Excel General
    Replies: 2
    Last Post: 06-03-2005, 02:05 PM
  7. Help with Latitude and Longitude.
    By LadiFireBug in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-22-2005, 05:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1