Calculating Distance between two sets of geographic coordinates using only zip codes or cities

Sdílet
Vložit
  • čas přidán 6. 09. 2024
  • This video used Excel data type Geography and Power Query to find the difference between 2 sets of coordinates. Using only zip codes, you can extract Lat and Long using Excel data types; these tables are then loaded into a power query to find the distance between points.
    Power Query M Formula for Distance in Miles (Replace all the Bold with your column names):
    Number.Acos(Number.Cos((90-[Latitude])*Number.PI/180)*Number.Cos((90-[Leads.Latitude])*Number.PI/180)
    + Number.Sin((90-[Latitude])*Number.PI/180)*Number.Sin((90-[Leads.Latitude])*Number.PI/180)*Number.Cos(([Longitude]-[Leads.Longitude])*Number.PI/180)) * 3959

Komentáře • 12

  • @ziggle314
    @ziggle314 Před 4 měsíci +1

    Nice job. I like seeing a good application for the geographic data type. Thanks!

  • @naturelover7998
    @naturelover7998 Před 5 měsíci +1

    Finally found the solution, thank you so much for video. great Job...

    • @excel4urparents242
      @excel4urparents242  Před 5 měsíci

      I’m so glad you found this useful, and it was able to help.

  • @hspgutub
    @hspgutub Před 2 měsíci

    Great explanation. Thank you!!!

  • @patrickdowe208
    @patrickdowe208 Před 4 měsíci

    This is brilliant. Thank you. What if I'm trying to get clusters of the lead addresses, i.e., grouping addresses that are close to each other.

  • @kebincui
    @kebincui Před 5 měsíci

    Excellent 👍 🌹

  • @lorismetro7729
    @lorismetro7729 Před 7 měsíci

    I don't understand what is "lead" and why you created other columns labeled with "lead". By the way this is a great video. Thank you.

    • @excel4urparents242
      @excel4urparents242  Před 7 měsíci

      Hi @lorismetro7729 I'm glad you enjoyed the video! A lead is a sales term meaning a potential customer or prospect who has expressed interest in a product or service. I know there are many different uses for distance calculations, I come from a sales analytics background, so I put it in this context. Thank you for mentioning it, I will try and use more generic terms in the future!

  • @user-rg8vi7ct2r
    @user-rg8vi7ct2r Před 6 měsíci

    Hi, is a car dirving distance? or is a air line distance between two points?

  • @user-fy1ng5xd5i
    @user-fy1ng5xd5i Před 6 měsíci

    Can we deliver this using sql server only?