Need to compare Latitude & Longitude coordinates to find closest office

PaulCL

New Member
Joined
Jul 9, 2014
Messages
43
I have a list of 20,000 addresses(List A) and another list of 2,500 offices(List B) that are both geocoded. I need to determine, in miles, which of the 20,000 addresses are closest to which 2,500 offices. Is there an excel formula that would help me solve this?
Thanks!

Sample

List A
Address1CityStateZipLatitudeLongitude
119 TINE LANENEW MARKETAL3576134.83257949-86.46106284
1177 LEWIS MTN. RDGUNTERSVILLEAL3597634.42853529-86.30492038
2980 COUNTY RD 53TUSKEGEEAL3608332.47986191-85.64240964
617 CHERRY ST NWDECATURAL3560134.61583017-86.99362234
2300 HACKBERRY LANE

List B
HOOVERAL3522633.42695376-86.82373959

<colgroup><col><col><col><col><col><col></colgroup><tbody>
</tbody>
Office IDDBALatitudeLongitude
AR3021st Corner35.22692-90.78813873
AR3021st Corner35.22541-90.788153
AR3021st Corner35.82997-90.67296349
AR3021st Corner35.22169-90.82464634
AR3021st Corner35.86746-90.71383514
AR3021st Corner35.84989-90.64110695
MO306Advantage38.56485-90.38050127
MO306Advantage38.58855-90.350542
MO306Advantage38.55125-90.39158163
MO306Advantage38.60448-90.37092379

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 
i am at a loss to why this fomula is not working. i read previously about how to invoke the formula. if I use the original formula =INDEX($A$3:$A$7,MATCH(SMALL((ABS(J3-$E$3:$E$7)^2+ABS(K3-$F$3:$F$7)^2)^(0.5),1),(ABS(J3-$E$3:$E$7)^2+ABS(K3-$F$3:$F$7)^2)^(0.5),0)) with control **** enter i have no problem.

if i correct the formula for my dataset
=INDEX($A$3:$A$1200,MATCH(SMALL((ABS(J3-$E$3:$E$1200)^2+ABS(K3-$F$3:$F$1200)^2)^(0.5),1),(ABS(J3-$E$3:$E$1200)^2+ABS(K3-$F$3:$F$1200)^2)^(0.5),0)) i get a value error.

all i changed to the 7's to 1200 to account for my dataset.
I am grateful for any other thoughts or ideas on this.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
This is fantastic. It works great for me. I have one question though. How could I adapt this formula to find the nth closest affiliate to a given lat/long? (I really just want to find the top 5)

Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,741
Members
449,050
Latest member
excelknuckles

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