I have a column with a list of stores.
On another sheet, I have a master list of stores, with their corresponding latitudes and longitudes.
Given 2 stores, I have a formula that computes the distance between them using each location's latitude and longitude.
I need an array that will find the maximum distance in the list of given stores.
For example, I input 10 stores. The array would look up the locations (lat & long) of each one of the 10 stores, find the distance for each one to each of the other 9 locations in the list, and find the maximum distance from the 100 possible scenarios (the 10 x 10 matrix).
The formula for computing distance is:
=(ACOS((COS((lat1/180)*PI())*COS((lat2/180)*PI())*COS(((long2-long1)/180)*PI()))+(SIN((lat1/180)*PI())*SIN((lat2/180)*PI()))))*3963.19
So if my list of stores was in E3 to E13:
long1 = vlookup(E3,'Master Store List'!$C:$J,8,FALSE)
lat1 = vlookup(E3,'Master Store List'!$C:$J,7,FALSE)
long2 = vlookup({E$3:E$13},'Master Store List'!$C:$J,8,FALSE)
lat2 = vlookup({E$3:E$13},'Master Store List'!$C:$J,7,FALSE)
I know that array within the LOOKUP function isn't corrent syntax, but that's what I'm after.
It would be nice to know which of the 2 locations provide the maximum distance as well, but thats a minor issue compared to the max distance.
Thanks in advance for any assitance you can give...
Bookmarks