Forum Discussion

FasasiOlalemiola2biz's avatar
FasasiOlalemiola2biz
Copper Contributor
Aug 24, 2024

Distance between Latitude and Longitude in Excel

How can I derive the distance between two points in Excel given Latitude and Longitudes?

5 Replies

  • FasasiOlalemiola2biz 

    Worksheet formula
    = GreatCircDistλ(origin, destination)
    
    GreatCircDistλ
    =LAMBDA(p₁, p₂, 
        LET(
            ϕ₁, RADIANS(p₁.[latitude]),
            λ₁, RADIANS(p₁.[longitude]),
            ϕ₂, RADIANS(p₂.[latitude]),
            λ₂, RADIANS(p₂.[longitude]),
            r,  6378,
            r * ACOS(SIN(ϕ₁)*SIN(ϕ₂) + COS(ϕ₁)*COS(ϕ₂)*COS(λ₂-λ₁))
        )
    )
  • Hecatonchire's avatar
    Hecatonchire
    Iron Contributor

    Hello,

     

    Point A =>A2/B2 (ex : 45.762°/4.822°)

    Point B =>C2/D2 (ex: 44.869°/-0.533°)

    Result : 430 Km

     

    =2*6371*ASIN(RACINE((SIN((RADIANS(C2)-RADIANS(A2))/2))^2+COS(RADIANS(C2))*COS(RADIANS(A2))*(SIN((RADIANS(D2)-RADIANS(B2))/2))^2))
    =ACOS(SIN(RADIANS(A2))*SIN(RADIANS(C2))+COS(RADIANS(A2))*COS(RADIANS(C2))*COS(RADIANS(B2-D2)))*6371
  • mathetes's avatar
    mathetes
    Silver Contributor

    FasasiOlalemiola2biz 

     

    How can I derive the distance between two points in Excel given Latitude and Longitudes?

     

    How would you do it without Excel? That's not meant to be a dismissive question; rather, if I knew how to do it "on paper" or with pencil and paper and some other information on latitude and longitude lines and how they're determined in the first place, then I might be able to say how to do it with Excel.

     

    My sense, though, is that it's not readily answered by just knowing, say, 

    and

     

    If you can use formulas to tell us the distance between those two points, and tell us how you did it, I might be able to tell you how Excel could accomplish the same. Now, I happen to know the distance between those two points when driving by car, so I'll be able to determine whether your answer is plausible.

Resources