+ Reply to Thread
Results 1 to 2 of 2

build distance matrix

  1. #1
    Registered User
    Join Date
    10-08-2009
    Location
    madrid, spain
    MS-Off Ver
    Excel 2007
    Posts
    1

    build distance matrix

    Hello and cheers to everybody since this is my first post in this forum.

    My problem is how to build a distance matrix of several geographic locations.

    In my Excel table I have 3 columns:

    locations locations distance

    A B 12
    B D 25
    C C 35
    D A 50

    I would like to generate a table (like the old notebooks used to have) where on the horizontal axis I would have A,B,C,D and the same on the vertical, something like this:

    A B C D
    A - 12 35 50
    B - ...and so on
    C
    D

    Is there any simple way to do this in excel?

    Thank you very much in advance and have a very nice day!

  2. #2
    Forum Contributor
    Join Date
    12-02-2008
    Location
    India
    Posts
    118

    Re: build distance matrix

    Hey!
    It can be done using lookup but there'll be a lot of NA errors if u dont have an exhaustive list of all the possible combinations of cities....

    In matrix, cell B2=lookup(2,1/((A2=A1:A40)*(B1=B1:B40)),C1:C40)

    A1:A40, B1:B40, C1:C40 are references from ur original table having From,To,Distance columns..

    Hope dat helps

    Regards
    Mohit

+ Reply to Thread

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