Morning,

I'm hoping you guys can point out the error I have here? As part of my research I'm including a variable with the distance (in miles) from the capital of my donor country to the capital of every other country in the world. I've been trying to use the Haversine formula, found here: http://andrew.hedges.name/experiments/haversine/ but I can't get it to work in excel.

Formula:
dlon = lon2 - lon1
dlat = lat2 - lat1
a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2
c = 2 * atan2( sqrt(a), sqrt(1-a) )
d = R * c (where R is the radius of the Earth 6373 km)

My Excel:
a =(SIN(dlat/2)^2+(COS(Capitals[@Latitude])*(COS(lat2)*((SIN(dlon/2))^2))))
c =2*(ATAN2(SQRT(a), SQRT(1-a)))
d =R*c

As a test I've been using

New Zealand
Lat:-41.29
Long: 174.78

Afghanistan
Lat: 34.53
Long: 69.17

for output I get
a = 0.332632
c = 1.912...
d = 12182.13

whereas the answer is actually 13650.679. I suspect the issue is to do with degrees to radians but I'm not sure how to incorporate that into the formula?