I've got two arrays, each one includes shop ids, x coordinates and y coordinates for us and the competition.

I'm looking to get for each shop of ABC corp, its closest competitor in list XYZ corp.

So far, I've managed to get the distance between each ABC shop and its closest XYZ comp, with an array formula in col. H :

```
'{MIN((sqrt((Power(B3-$F$3:$F$6;2)+(power(C3-$G$3:$G$6;2))))))}
```

I'm stuck in finding for each ABCi the name XYZi (or line reference) corresponding to the calculated value in H.

I've been fiddling for two hours with Match()and Index() –as suggested in various similar questions on SE– and googling all I can think of but to no avail.

(I seem to recall that for XY coordinates on a spheroid the formula for distance between two points on a map might be different from the one used here, but for my real life purpose it's good enough.)