The Excel GreatCircleDistance function returns the line-of-flight distance between two latitude-longitude pairs.
=GreatCircleDistance(lat1, long1, lat2, long2)
lat1, long1 are the coordinates of the origin
lat2, long2 are the coordinates of the destination
=GreatCircleDistance(1,2,3,4) returns 5
The distance is calculated using Vincenty’s formulae, with fallback to the Haversine formula when Vincenty’s method doesn’t converge.
The results are accurate to better than 0.5mm for all cases except those where Haversine is used. These all occur at longitudes between -179.5 and 179.5, which are in the middle of the Pacific.