I am creating an application to calculate the distance between airports. I believe your formula should handle this. I have a spreadsheet with four columns titled: From Latitude, From Longitude, To Latitude, and To Longitude. The fifth column is for Distance.
I plugged your formula into column 5. I get a "VALUE" error. Obviously I'm missing something here, or I have a syntax issue. I have included my first row of waypoints. I know the distance should be about 180 miles. I appreciate your comments.
N58° 43' 42.01",W156° 56' 25.35" and N58° 40' 36.49",W156° 38' 57.18"