PDA

View Full Version : Solution to find overlapping rectangles given co-ordinates



deusextra
08-15-2013, 03:10 AM
Hello Forum

I have the following problem:

I need to find which pairs of rectangles overlap (when plotted on an axis) where I'm given the four corners
as X and Y co-ordinates.

For example:
Rectangle A) X(1,3) Y(2,4)
Rectangle B) X(3,5) Y(4,6)
Rectangle C) X(5,7) Y(7,9)
Rectangle D) X(6,8) Y(8,10)

For these 4 rectangles the following rectangles overlap; A&B and C&D

What I'm looking for is an automated method that given the X and Y co-ordinates can give all pairings
of overlapping rectangles for a long list of rectangles (given as the co-ordinates of the 4 corners).

I have attached a sample excel file that gives a visual representation and a list of the rectangles this is needed for.

If someone could find a way to do this or even articulate a possible method for solving the problem then this would be greatly appreciated.

10447

snb
08-15-2013, 04:31 AM
In G3:

=AND(B3<=D2;C3<=E2)

Fill down in column G

deusextra
08-15-2013, 04:40 AM
Thanks snb, although I get a #Value error for all entries when I do that?

Would you be able to do it on the Excel sample file if you are not getting the #Value errors?

Also please see updated Excel sample file which gives a clearer indication of the desired output.

Thanks again.

snb
08-15-2013, 05:28 AM
see the attachment

deusextra
08-28-2013, 01:59 PM
Thanks snb. This is not quite what I was looking for though. Does anybody else have any ideas? This would be massively appreciated!

snb
08-29-2013, 02:03 AM
Your feedback is hardly worth mentioning it as such.

SamT
08-29-2013, 07:33 AM
:rofl: