# Complex Distance Formula

#### dkoucky

##### New Member
Hi,

I am trying to find the nearest distance between many points. I have a set of about 300 coordinates that I am comparing to a list of about 4k coordinates. I am using the formula:

The cells are explained below:

This seems to work fine if comparing the list of 4k against the 300 but if I flip it around it just returns somewhat random numbers mostly 1 and 6, I assume this is somehow limited to the first x number of references? Is there another formula I can run or should I do this outside of excel?

Thanks!

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### pbornemeier

##### Well-known Member
What do you mean by "flip it around"? Please explain your setup for 4K vs 300 and 300 vs 4K.

#### dkoucky

##### New Member
I think the formula is the great circle but it has been a while since I first used it and I have just been copying it. Do you know how/where I can use it in code? I am not sure if there is a way to host a file on this form I have uploaded the file via zippyshare here: https://www40.zippyshare.com/v/m72PpET4/file.html

Replies
2
Views
279
Replies
6
Views
103
Replies
4
Views
244
Replies
4
Views
118
Replies
2
Views
175

1,132,706
Messages
5,654,841
Members
418,155
Latest member
demasisi

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back