MisterMatthieu
New Member
- Joined
- Jul 14, 2019
- Messages
- 1
Hello,
I have two lists of places (in two Excel sheets) : cities and swimming pools.
I have the lat and long of all the places (for the cities it's the center).
I want to extract a list of all the pools nearby every cities.
So I would have a final list like this :
- Name of the city / CityLat / CityLong / Name of a pool closer than 50km
- Name of the city / CityLat / CityLong / Name of an other pool closer than 50km
- etc.
For now I have a formula (that seems accurate) to calculate the distance between two points :
=ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2))) *6371
But I have no clue how to adapt it to my needs.
I also try this VBA fonction that don't seems to work : http://www.codecodex.com/wiki/Calculate_Distance_Between_Two_Points_on_a_Globe#Excel
Can someone help me on this one.
Thanks
I have two lists of places (in two Excel sheets) : cities and swimming pools.
I have the lat and long of all the places (for the cities it's the center).
I want to extract a list of all the pools nearby every cities.
So I would have a final list like this :
- Name of the city / CityLat / CityLong / Name of a pool closer than 50km
- Name of the city / CityLat / CityLong / Name of an other pool closer than 50km
- etc.
For now I have a formula (that seems accurate) to calculate the distance between two points :
=ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2))) *6371
But I have no clue how to adapt it to my needs.
I also try this VBA fonction that don't seems to work : http://www.codecodex.com/wiki/Calculate_Distance_Between_Two_Points_on_a_Globe#Excel
Can someone help me on this one.
Thanks