=ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2))) *6371
=ACOS(COS(RADIANS(90-A2)) *COS(RADIANS(90-A3)) +SIN(RADIANS(90-A2)) *SIN(RADIANS(90-A3)) *COS(RADIANS(B2-B3))) *6371
That'll work for a table set up like this:
Name | Lat | Long |
---|---|---|
SF | 37.7749 | -122.4194 |
Sac | 38.5816 | -121.4944 |
Just change A2, A3, B2, B3 to other cells as needed.
6371 = earth's average radius in kilometers
For miles, substitute 6371 with 3958.756
For nautical miles, use 3440.065