
MS Excel 'standard' formula
Given the following input fields (in degrees): From latitude (cell A2), From longitude (cell B2), To latitude (cell C2), To longitude (cell D2), the formula isDependent on your MS Excel setting you may have to replace the semicolon by a comma.
Alternative user defined function: MS Excel VBA code to be put in a module
Note: in general, a user defined function will execute slower than a standard function, which can become a disadvantage in case of a large amount of formulas.In MS Excel, press Alt+F11 to open the Visual Basic Editor (Windows). Via top menu: Insert → Module. Copy the MS Excel VBA code below into the module.