SlightlyClueless
New Member
- Joined
- Dec 10, 2018
- Messages
- 15
- Office Version
- 365
- Platform
- Windows
Hello All,
For the past day now I have been working on a solution to return locations that fall within a 1/4 mile and 1/2 mile radius of a specific site. There is a list of about 3,000 sites that would need to be bounced off a portfolio (10,000+ locations) to see if they fell within a 1/4 mile and 1/2 mile radius of a location/locations in the portfolio. All the location data is Decimal Degrees format. In order to get things working properly first, I made a small mock data set to work with. A link to google drive to download that workbook is below. So far I have been able to get a site to return the closest match from the portfolio and the distance the site is from the portfolio match. However, in the real dataset along with the test data set, there may be more than one match from the portfolio. What do is needed to be done in order for each site to list the match/matches from the portfolio that fall in a 1/4 mile and 1/2 mile radius?
Site List
Distance formula
Nearest Location formula
Portfolio
Google Drive Link
For the past day now I have been working on a solution to return locations that fall within a 1/4 mile and 1/2 mile radius of a specific site. There is a list of about 3,000 sites that would need to be bounced off a portfolio (10,000+ locations) to see if they fell within a 1/4 mile and 1/2 mile radius of a location/locations in the portfolio. All the location data is Decimal Degrees format. In order to get things working properly first, I made a small mock data set to work with. A link to google drive to download that workbook is below. So far I have been able to get a site to return the closest match from the portfolio and the distance the site is from the portfolio match. However, in the real dataset along with the test data set, there may be more than one match from the portfolio. What do is needed to be done in order for each site to list the match/matches from the portfolio that fall in a 1/4 mile and 1/2 mile radius?
Site List
Distance formula
Excel Formula:
=INDEX(ACOS(COS(RADIANS(90-Portfolio!$C$2:$C$6)) *COS(RADIANS(90-C2)) +SIN(RADIANS(90-Portfolio!$C$2:$C$6)) *SIN(RADIANS(90-C2)) *COS(RADIANS(Portfolio!$D$2:$D$6-D2)))*3958.756,MATCH(SMALL((ABS(C2-Portfolio!$C$2:$C$6)^2+ABS(D2-Portfolio!$D$2:$D$6)^2)^(0.5),1),(ABS(C2-Portfolio!$C$2:$C$6)^2+ABS(D2-Portfolio!$D$2:$D$6)^2)^(0.5),0))
Nearest Location formula
Excel Formula:
=INDEX(Portfolio!$A$2:$A$6,MATCH(SMALL((ABS(C2-Portfolio!$C$2:$C$6)^2+ABS(D2-Portfolio!$D$2:$D$6)^2)^(0.5),1),(ABS(C2-Portfolio!$C$2:$C$6)^2+ABS(D2-Portfolio!$D$2:$D$6)^2)^(0.5),0))
Portfolio
Google Drive Link
VBA Code:
https://drive.google.com/uc?export=download&id=1eaDyUrjGjonV6iJkMa1Tac2v6NfquIsx