+ Reply to Thread
Results 1 to 7 of 7

re-numbering a list of numbers based on another list of numbers to get a sequential order

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    anamosa, iowa
    MS-Off Ver
    Excel 2007
    Posts
    34

    re-numbering a list of numbers based on another list of numbers to get a sequential order

    I have a list of numbers in a column. They are stops on a truck route. in another column, i have a list of numbers. They are backhauls that are inserted into the route. I need a formula to re-number the stops based on where the backhauls in the route have been inserted. ex:
    Stops: (re-numbered): Backhauls:
    1 1 4
    2 2 5
    3 3 7
    4 6
    5 8
    6 9
    Last edited by ryan.wherry; 11-11-2014 at 06:12 PM.

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: re-numbering a list of numbers based on another list of numbers to get a sequential or

    The formatting of the example you provided (at least to me) does not provide much insight as to what you need done. Can you upload a sample workbook with a "Before" setup, as well as an "After" setup of how you wish your data to look?
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Registered User
    Join Date
    03-07-2013
    Location
    anamosa, iowa
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: re-numbering a list of numbers based on another list of numbers to get a sequential or

    Sample book.xlsxSorry. First time i've used a forum. I've attached a sample. hope this makes more sense.

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: re-numbering a list of numbers based on another list of numbers to get a sequential or

    No worries! Welcome to the forum...quick question about your data; will it be dynamic? That is, will you only ever have 6 route stops as a maximum?

  5. #5
    Registered User
    Join Date
    03-07-2013
    Location
    anamosa, iowa
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: re-numbering a list of numbers based on another list of numbers to get a sequential or

    Yes. it will have to be dynamic. the # of stops will always be different. anywhere from 1 to 22 stops. where i get into trouble is when i put 2 backhauls back to back. for instance: adding a backhaul as stops 4 and 5, so every route stop after increases by 2.

  6. #6
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: re-numbering a list of numbers based on another list of numbers to get a sequential or

    For your spreadsheet, are you allowed to have a helper column that you can hide? If so, I think I have a solution. See attached:
    Attached Files Attached Files
    Last edited by mcmahobt; 11-10-2014 at 02:45 PM.

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: re-numbering a list of numbers based on another list of numbers to get a sequential or

    See attached.
    In H1, I calculated the number of unique stops
    =SUMPRODUCT(--(--(ISNUMBER(MATCH($A$3:$A$8,$C$3:$C$8,0)))=0))+COUNT($C$3:$C$8)

    In G3 copied down, I entered this Arrayed Formula

    =IF(ROWS($A$1:$A1)>$H$1,"",IFERROR(INDEX($A$3:$A$8, SMALL(IF(NOT(ISNUMBER(MATCH($A$3:$A$8,$C$3:$C$8,0))), $A$3:$A$8),ROWS($A$1:$A1))),G2+1))
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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. Assign sequential numbers to unique values in a list
    By penfold in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-30-2017, 02:11 PM
  2. Numbering a sequential list, but exclude a list of given numbers.
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2012, 03:29 AM
  3. Generating list of sequential numbers (sans formulas)
    By gregorybrian in forum Excel General
    Replies: 2
    Last Post: 06-21-2009, 11:22 AM
  4. How do i identify missing numbers in a sequential list
    By Chet-a-roo in forum Excel General
    Replies: 4
    Last Post: 08-05-2005, 03:05 PM
  5. [SOLVED] How do I create a list of sequential numbers using Excel or Acces.
    By Clueless in forum Excel General
    Replies: 2
    Last Post: 04-05-2005, 11:06 AM

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