I have a list of locations, with their coordinates, and I have a set of regions of which I have the coordinates of the border points. Now I would like excel to specify for me in what region every location is.
I was thinking of using a nested IF function, but I have up to 20 regions so I am hoping there may be an easier way to do this.
For example:
[TABLE="width: 607"]
<colgroup><col><col><col span="4"></colgroup><tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]location[/TD]
[TD]N[/TD]
[TD]E[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]location 1[/TD]
[TD="align: right"]51,2088[/TD]
[TD="align: right"]5,995877[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]name[/TD]
[TD]top[/TD]
[TD]left[/TD]
[TD]bottom[/TD]
[TD]right[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]region 1[/TD]
[TD="align: right"]51,068352[/TD]
[TD="align: right"]5,661775[/TD]
[TD="align: right"]50,745750[/TD]
[TD="align: right"]6,054801[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]region 2[/TD]
[TD="align: right"]51,561538[/TD]
[TD="align: right"]5,823070[/TD]
[TD="align: right"]51,068352[/TD]
[TD="align: right"]5,661775[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]region 3[/TD]
[TD="align: right"]51,561538[/TD]
[TD="align: right"]5,201854[/TD]
[TD="align: right"]51,068352[/TD]
[TD="align: right"]5,823070[/TD]
[/TR]
</tbody>[/TABLE]
So if C2 falls between C5 and E5, AND D2 falls between D5 and F5, I want it to tell me region 1.
Else if C2 falls between C6 and E6, AND D2 falls between D6 and F6, I want it to tell me region 2, etc.
Is there any function that can do this more easily?
I was thinking of using a nested IF function, but I have up to 20 regions so I am hoping there may be an easier way to do this.
For example:
[TABLE="width: 607"]
<colgroup><col><col><col span="4"></colgroup><tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]location[/TD]
[TD]N[/TD]
[TD]E[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]location 1[/TD]
[TD="align: right"]51,2088[/TD]
[TD="align: right"]5,995877[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD]name[/TD]
[TD]top[/TD]
[TD]left[/TD]
[TD]bottom[/TD]
[TD]right[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]region 1[/TD]
[TD="align: right"]51,068352[/TD]
[TD="align: right"]5,661775[/TD]
[TD="align: right"]50,745750[/TD]
[TD="align: right"]6,054801[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD]region 2[/TD]
[TD="align: right"]51,561538[/TD]
[TD="align: right"]5,823070[/TD]
[TD="align: right"]51,068352[/TD]
[TD="align: right"]5,661775[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD]region 3[/TD]
[TD="align: right"]51,561538[/TD]
[TD="align: right"]5,201854[/TD]
[TD="align: right"]51,068352[/TD]
[TD="align: right"]5,823070[/TD]
[/TR]
</tbody>[/TABLE]
So if C2 falls between C5 and E5, AND D2 falls between D5 and F5, I want it to tell me region 1.
Else if C2 falls between C6 and E6, AND D2 falls between D6 and F6, I want it to tell me region 2, etc.
Is there any function that can do this more easily?