MrExcel
.
- Joined
- Feb 8, 2002
- Messages
- 3,414
- Office Version
- 365
- Platform
- Windows
MILESBETWEENCITIES will calculate the miles between two geography data types. Each data type must support the latitude and longitude field.
Excel Formula:
=LAMBDA(From,To,(3959*2)*ASIN(SQRT(0.5-COS((To.Latitude-From.Latitude)*PI()/180)/2+COS(From.Latitude*PI()/180)*COS(To.Latitude*PI()/180)*(1-COS((To.Longitude-From.Longitude)*PI()/180))/2)))
Upvote
0