Results 1 to 8 of 8

Cure my array headache!

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2005
    Posts
    62

    Question Cure my array headache!

    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...
    Last edited by grime; 07-26-2005 at 01:06 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1