Finding if a set of coordinates is in a particular area

rico355

New Member
Joined
May 20, 2018
Messages
1
Is it possible to use excel to find if a particular set of coordinates falls within an area (composed of coordinates, like a fence)?

In the example below, I have coordinates for all four corners of a made-up home, gym, and work site. I am trying to see if Excel is capable of recognizing what site the Sample Points are located in.
Note: Sample Point 1 = Home, Sample Point 2 = Gym, Sample Point 3 = Work.


[TABLE="width: 849"]
<tbody>[TR]
[TD][/TD]
[TD="colspan: 2, align: center"]Corner 1[/TD]
[TD="colspan: 2, align: center"]Corner 2[/TD]
[TD="colspan: 2, align: center"]Corner 3[/TD]
[TD="colspan: 2, align: center"]Corner 4[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[/TR]
[TR]
[TD]Home[/TD]
[TD]29.929715[/TD]
[TD]-95.250671[/TD]
[TD]29.92932[/TD]
[TD]-95.250758[/TD]
[TD]29.929679[/TD]
[TD]-95.250428[/TD]
[TD]29.92933[/TD]
[TD]-95.250389[/TD]
[/TR]
[TR]
[TD]Gym[/TD]
[TD]29.937167[/TD]
[TD]-95.248193[/TD]
[TD]29.937171[/TD]
[TD]-95.247482[/TD]
[TD]29.936654[/TD]
[TD]-95.248173[/TD]
[TD]29.936656[/TD]
[TD]-95.247466[/TD]
[/TR]
[TR]
[TD]Work[/TD]
[TD]29.935902[/TD]
[TD]-95.248618[/TD]
[TD]29.935912[/TD]
[TD]-95.247947[/TD]
[TD]29.935369[/TD]
[TD]-95.248625[/TD]
[TD]29.935379[/TD]
[TD]-95.247929[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"]x[/TD]
[TD="align: center"]y[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sample Point 1[/TD]
[TD]29.929436[/TD]
[TD]-95.250624[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sample Point 2[/TD]
[TD]29.936901[/TD]
[TD]-95.247904[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sample Point 3[/TD]
[TD]29.935536[/TD]
[TD]-95.248331[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Is it possible to use excel to find if a particular set of coordinates falls within an area (composed of coordinates, like a fence)?

In the example below, I have coordinates for all four corners of a made-up home, gym, and work site. I am trying to see if Excel is capable of recognizing what site the Sample Points are located in.
Note: Sample Point 1 = Home, Sample Point 2 = Gym, Sample Point 3 = Work.


[TABLE="width: 849"]
<tbody>[TR]
[TD][/TD]
[TD="colspan: 2, align: center"]A[/TD]
[TD="colspan: 2, align: center"]B[/TD]
[TD="colspan: 2, align: center"]C[/TD]
[TD="colspan: 2, align: center"]D[/TD]
[/TR]
[TR]
[TD="align: center"][/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]y[/TD]
[/TR]
[TR]
[TD]Home[/TD]
[TD]29.929715[/TD]
[TD]-95.250671[/TD]
[TD]29.92932[/TD]
[TD]-95.250758[/TD]
[TD]29.929679[/TD]
[TD]-95.250428[/TD]
[TD]29.92933[/TD]
[TD]-95.250389[/TD]
[/TR]
[TR]
[TD]Gym[/TD]
[TD]29.937167[/TD]
[TD]-95.248193[/TD]
[TD]29.937171[/TD]
[TD]-95.247482[/TD]
[TD]29.936654[/TD]
[TD]-95.248173[/TD]
[TD]29.936656[/TD]
[TD]-95.247466[/TD]
[/TR]
[TR]
[TD]Work[/TD]
[TD]29.935902[/TD]
[TD]-95.248618[/TD]
[TD]29.935912[/TD]
[TD]-95.247947[/TD]
[TD]29.935369[/TD]
[TD]-95.248625[/TD]
[TD]29.935379[/TD]
[TD]-95.247929[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: center"]x[/TD]
[TD="align: center"]y[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sample Point 1[/TD]
[TD]29.929436[/TD]
[TD]-95.250624[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sample Point 2[/TD]
[TD]29.936901[/TD]
[TD]-95.247904[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sample Point 3[/TD]
[TD]29.935536[/TD]
[TD]-95.248331[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
OK.. You have to follow me very carefully.
Order of the corners has a great importance.
Corners B and D should not be neighbors. They should be opposing corners. Since A, B, C, D is a 4-corner polygon:

1. Draw a line from corner B to D. Now you have a ABD triangle and DBC triangle. Calculate each triangle's area by coordinates theorem. Can I find the total area of the polygon if I merge these triangles base-to-base? Yess..
2. You can merge two triangles and find the total area of polygon.
3. Then think the point hits in a polygon range. Then you may think it as a cake. You can make 4 slices in the shape of a triangle.
4. If sum of all slices equals to total area of polygon, then yes the point is inside the rectangle.

Ok.. Things are getting complicated. Please follow the sample workbook below:
https://drive.google.com/file/d/1TLIq3RUM602qC9iGvtLnOFlAl-IB56VT/view?usp=sharing

Useful resources:
https://math.stackexchange.com/questions/190111/how-to-check-if-a-point-is-inside-a-rectangle
https://www.mathopenref.com/coordtrianglearea.html
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top