+ Reply to Thread
Results 1 to 8 of 8

Excel Mapping States

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Excel Mapping States

    Hi, Everyone! I have a situation here and I want to resolve it via excel. Excel File Attached. In Column A, we have driver home state. The column B is where the driver deliver the goods. Now we have to plan the (shortest route of driver such that the driver ends up in the home state eventually and the driver continues to the same cycle again. For example, lets say driver starts from WV and Ends up in NC.

    Then from NC he can go to any state as given below(copies from excel), but we will prioritize(not necessarily NC-->PA as priority number(column C) is highest among all. The same step we will repeat from PA to Any other state(given in excel). Until the driver ends up home at NC.

    NC-->PA
    NC-->FL
    NC-->OH
    NC-->SC
    NC-->GA
    NC-->MI
    NC-->NJ
    NC-->NC
    NC-->MD
    NC-->KY
    NC-->VA
    NC-->AL
    NC-->IA
    NC-->MA
    NC-->OK
    NC-->TN
    NC-->WV
    NC-->CT
    NC-->MS
    NC-->CO

    So in the end we will have a one best route for driver living in NC. Lets say that in this case hypotherical route would be (NC-->PA-->OH-->FL-->NC).

    Throughout this process we have to keep in mind that every driver in all 50 states cannot go to all 50 states, as you can see that in case of NC, the driver can go to following states only(as shown in column B). Secondly, we have to priorities the driver next destination/deliver location based on the priority number shown in column C.
    Exce Forum 1.PNG

    NC-->PA
    NC-->FL
    NC-->OH
    NC-->SC
    NC-->GA
    NC-->MI
    NC-->NJ
    NC-->NC
    NC-->MD
    NC-->KY
    NC-->VA
    NC-->AL
    NC-->IA
    NC-->MA
    NC-->OK
    NC-->TN
    NC-->WV
    NC-->CT
    NC-->MS
    NC-->CO .

    Since we have 50 states in column A so we would find one single best route(Total 50 Routes) for all 50 states such that driver ends up home eventually.

    Please let me know if it's possible via excel. Thanks and Regards
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel Mapping States

    First two questions

    NC-->PA
    Then the highest priority for the PA-->? is in fact PA (priority 30). Is that a typo or does the system need to detect this and choose the next highest which is PA-->NY (priority 26)

    But then the highest priority for the NY--> ?? delivery is back to PA (priority 57) and the second highest priority is NC (priority 34) the starting point.

    What does the model assume? Ignore all previous delivery stops?

    Please provide a complete worked example so that we may fully understand this.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Excel Mapping States

    The ultimate goal is we have to complete the loop for driver back home making sure that we prioritize based on priority number. In case loop is not getting completed then we can choose the second highest priority for same location.

    Coming to your First question "Is that a typo or does the system need to detect this and choose the next highest which is PA-->NY (priority 26)" ,The answer is The system need to detect this and choose the next highest whch is PA-->NY .

    Regarding Your second question: "But then the highest priority for the NY--> ?? delivery is back to PA (priority 57) and the second highest priority is NC (priority 34) the starting point." the system should choose the second priority which is to NC and starting point and the driver will be back home.

    System shouldn't keep track of previous delivery stops. If we look into it then one driver won't reach the same location twice if we want the driver to reach home(starting point).

    Let me know if I have missed anything. And thanks for your questions.

  4. #4
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Excel Mapping States

    Is it possible thing via excel ?

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Excel Mapping States

    Quote Originally Posted by anonymous321 View Post
    System shouldn't keep track of previous delivery stops. If we look into it then one driver won't reach the same location twice if we want the driver to reach home(starting point).
    If we do not keep track of previous delivery stops then it might just end up in a never ending loop. For instance after NC >> PA >> NY, let's say for NY the top priority is PA, then if we do not keep track of previous delivery stops the route would end up in a never ending loop of NC >> PA >> NY >> PA >> NY >> PA >> and so on...

    So, I think we would certainly need to keep track of previous delivery stops, and you yourself do seem to be keeping track of previous stops as you mentioned in your response to the second question when you skipped the first priority PA and instead selected NC. I think you might be meaning to say that we should keep track of all delivery stops except the starting point because we certainly would have to reach the starting point again to close the route.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  6. #6
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Excel Mapping States

    Yes you are right. We want' to avoid never ending loop.

  7. #7
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Excel Mapping States

    Given that you have all the priorities listed in sheet 'Priorities' and the list of all states that you need routes for in sheet 'Routes' column A, you can use this macro -

    Please Login or Register  to view this content.
    But as you would see, for most home locations, the routes are ending up at state OR because from OR you only have 2 possible routes, one OR itself, and the other one which has already been included in the route. I am not sure how you plan to resolve this.

    Sample attached.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Excel Mapping States

    Okay. Is it possible that we don't display the routes that don't end up at the same state where they started?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel file into separate sheets based on states
    By needtodownload in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-18-2017, 04:05 PM
  2. [SOLVED] Ordering states in a pivot table so that United States appears at the bottom
    By cmcgath in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-30-2014, 05:29 PM
  3. Replies: 4
    Last Post: 04-13-2013, 06:19 AM
  4. Excel Game - American States
    By GMP87 in forum Excel General
    Replies: 6
    Last Post: 09-04-2012, 11:50 AM
  5. Excel Formula to extract top 5 states from column.
    By KINNEY0201 in forum Excel Formulas & Functions
    Replies: 34
    Last Post: 08-23-2010, 07:40 PM
  6. Replies: 5
    Last Post: 03-21-2007, 03:20 PM
  7. Does anyone have an excel macro that converts states to 2 digit f.
    By Bryghtfalcon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2005, 02:06 PM

Tags for this Thread

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