+ Reply to Thread
Results 1 to 5 of 5

re-ordering a list

  1. #1
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    120

    re-ordering a list

    I have been charged with tacking some info for the printers our company uses across the region. I need to populate a "Print Out" based on a printer selected from a dropdown. To make life easier, I want to sort the list. In the data source there are a few unnamed printers. so I run a formula to remove the blanks, then I run another to create an order list (listing which printer is first -by row number-, second, third, etc.).

    My problem is that there are a few with the same name. It seems that when I run the formula:
    =IF(ISNUMBER(IF($A2<>"",1+COUNTIF($A$2:$A$300,"<"&$A2))),IF($A2<>"",1+COUNTIF($A$2:$A$300,"<"&$A2)),"")

    I get duplicate numbers (39 comes up twice) and becuase of this, when I try to list them in order, when I try to place the 40th item, I get an error, since there is no item labeled 40.

    I tried added the row number to the end of the name (so that 2 of the same name would have a different sufix, such as - 2 or - 3), but it still doesn't work. Mind you, the above formual was found online (and slightley modified to error check), and seems to work except with duplicate names...

    I have made a sample (with only 30 active cells) and an easy to read list of names. Can someone tell me why it the countif is not incrementing from printerTOR-2 to printerTOR-7? If you look at the outcome of the above formula, they both are listed 8th...
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-26-2010
    Location
    Seattle Wa
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: re-ordering a list

    use colume b
    =IF(ISNUMBER(IF($B2<>"",1+COUNTIF($B$2:$B$269,"<"&$B2))),IF($B2<>"",1+COUNTIF($B$2:$B$269,"<"&$B2)),"")

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: re-ordering a list

    Your formula relates to column A but you've added the row number into column B.

    Try changing all the references from A to B

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    120

    Re: re-ordering a list

    face palm to myself... I had about 6 columns of formulas, I forgot to shift that over... Funny, I did that and there are no duplicated numbers, but for some reason the numbers start at 20.... I guess the 10 blank spots would take up the first 10 spots...

    am I going about this the right way? I'm kind of bullying my way through this stuff...

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: re-ordering a list

    When I tested, I had a similar situation. Delete any "blank" rows below the list.

    Regards

+ 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