mbpaul1987
New Member
- Joined
- Jan 15, 2014
- Messages
- 15
I have a rather interesting situation that I can't seem to find an easy solution to. I have a few workbooks that have 3000+ lines of data in them. I need to find a way to pull a count of items that are within a certain distance of other items. As a very simplified example I will use the following table:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Location (mile)[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]3.5[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]26[/TD]
[/TR]
</tbody>[/TABLE]
I need to find a way to to count the number of "I" that are within "2 miles" (this number will be variable) of an S. In the case of the example there are 4. My Initial thought was to try to find a way to conditionally format the "I" rows that meet that criteria then I can easily sort them and count them. However, Ultimately I am just looking for an overall count of items within a set distance from another Item.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Location (mile)[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]3.5[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]26[/TD]
[/TR]
</tbody>[/TABLE]
Thanks for any Help
Michael
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Location (mile)[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]3.5[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]26[/TD]
[/TR]
</tbody>[/TABLE]
I need to find a way to to count the number of "I" that are within "2 miles" (this number will be variable) of an S. In the case of the example there are 4. My Initial thought was to try to find a way to conditionally format the "I" rows that meet that criteria then I can easily sort them and count them. However, Ultimately I am just looking for an overall count of items within a set distance from another Item.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]Location (mile)[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]3.5[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD]I[/TD]
[TD]24[/TD]
[/TR]
[TR]
[TD]S[/TD]
[TD]26[/TD]
[/TR]
</tbody>[/TABLE]
Thanks for any Help
Michael