I have two sets of co-ordinates, one set shows landmarks and another set shows points where I want to find the nearest landmark to them.
For example;
There is more data than this, but this is an example of the layout.
For the vast majority of the points I have, I've done some sense checks on a map and they are fine. But for a handful, the wrong result appears.
For example above, Point 1 is closer to Landmark B, but Landmark A is given as the result.
The formula in H2 (nearest landmark) is =INDEX($A$1:$A$6476,MATCH(MIN(SQRT(($B$1:$B$6476-F2)^2+($C$1:$C$6476-G2)^2)),SQRT(($B$1:$B$6476-F2)^2+($C$1:$C$6476-G2)^2),0),1)
and this is copied down to all points. I got this formula from here.
Can anybody suggest why this might be happening please - and why it's only happening in some instances?
Any help appreciated!
For example;
Landmark | Lat | Long | Points | Lat | Long | Nearest Landmark | |||
Landmark A | 53.5168292 | -2.2036031 | Point 1 | 53.5171561 | -2.2036183 | Landmark A | |||
Landmark B | 53.5170875 | -2.2032919 | |||||||
There is more data than this, but this is an example of the layout.
For the vast majority of the points I have, I've done some sense checks on a map and they are fine. But for a handful, the wrong result appears.
For example above, Point 1 is closer to Landmark B, but Landmark A is given as the result.
The formula in H2 (nearest landmark) is =INDEX($A$1:$A$6476,MATCH(MIN(SQRT(($B$1:$B$6476-F2)^2+($C$1:$C$6476-G2)^2)),SQRT(($B$1:$B$6476-F2)^2+($C$1:$C$6476-G2)^2),0),1)
and this is copied down to all points. I got this formula from here.
Can anybody suggest why this might be happening please - and why it's only happening in some instances?
Any help appreciated!