View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions,microsoft.public.excel.misc
aneudul aneudul is offline
external usenet poster
 
Posts: 4
Default Which function? Biggest distance to the Nearest city ...

On 11 okt, 10:37, aneudul wrote:
Hi everyone here,
Normally I'd keep thinking for a solution by myself, but I've
recognized my own limitations.

This is my (your) challenge: (I'll use a imaginary case, to make my
point clear)
I got a list of, let's say, cities and their location; this is, x-y
coordinates.
I need to know which city is the most remote from its most neighboring
city; kind of: biggest minimum distance.

I know Pitagoras to calculate the distance:
if city A x=5 y=8
and city B x=1 y=3
then distance AB= ( deltax ^2 + deltay ^2 ) ^0.5
in this case AB= (4^2+5^2)^0.5 = 6.403

So, I need to know the biggest distance between EACH cell in the list
and the other ones ...
I suspect that I need to make a two-dimensional cross-table, with the
same list as column headers and row headers? (sorry about my english,
I have a Dutch version of the software).
Am I searching in the right direction?

I would appreciate any help, since I need to resolve this issue very
soon.

Thanks in advance!

Marcos


Thank you everyone for your valuable contributions.
I'm still testing these options and I'm not sure which way I should
take; but one thing is su I'm learning along the way, thank you
again!
Thank you Pete, for the INDEX/MATCH trick; very interesting! (thanks
Vezerid for giving form to it)
Thank you David, for the SQRT/SUMSQ trick; I know that from now ...
Bernard, I'm afraid I need to read your solution once more ...
And no, this is not homework. The cities story is an allegory, I'm
actually dealing with coordinates in a 3-D color space; the "cities"
are color shades within that space. So I use Pythagoras (with h, thank
you Bernard) in three dimensions.

Now, Vezerid, I think it's brilliant what you said. I suspect you are
right so far; that way it's just a 1D-problem, and that simplifies a
lot the matter.
But I'm afraid that apparently I've been not clear enough in my
explanation of the problem, in this way:
Sorry if I'm wrong, but you all thought that I was looking for the
biggest distance between any two cities? No.
I repeat: I need to know which city is the most remote from its most
neighboring.
How can I clarify ... let's say that I want to choose the city with
the most green areas around it!
This way, we should use MIN() first to know, for each city, the
distance to its closest neighbour. Call it 'next-door-distance'?
Just after that we can use (maybe MAX) to know which city has the
biggest 'next-door-distance' (the most remote 'aside'-neighbour). Or
just sort the values decreasing.
For instance: Vezerid, if I use your proposal, and I replace MAX with
MIN, then I get all 0-values, since the reference city is included in
the matrix of 'neigbours' (and the distance to itself is of course 0).
So, how can I exclude the reference city (row 2 in your example) from
the formula?

I'm very grateful to you all, guys
Have a nice day

Marcos