+ Reply to Thread
Results 1 to 8 of 8

Need a way to automatically sort into unique items in a particular order...

  1. #1
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Need a way to automatically sort into unique items in a particular order...

    I have a list of items in a column that changes week to week and I'm tired of having to copy that column, paste it in another spot, remove the duplicates, vlookup the order they need to be in, and sort it in that order...

    Is there a way to do all this automatically.. I don't care if I have to use helper column's with formula's, or vba code. Just whatever works.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,264

    Re: Need a way to automatically sort into unique items in a particular order...

    Hi trickyricky,

    See the attached. I think you just need an easy to make Pivot Table of Column C which returns Unique cells. That way you don't need to delete dups. Then you drag the data to the sum area and it does a count. Lastly you can sort by count. Is that what you wanted?

    See attached: If you have two columns of data it is almost as easy.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Re: Need a way to automatically sort into unique items in a particular order...

    Hello thanks for your time,

    That almost worked out for me but im not well versed with pivot tables. My goal is to have column C automatically put into unique values (which the pivot table does well), but then sorted in the order in column O. I don't need counts of each unique item.

    In the pivot table I couldn't figure out how to retrieve column O (the numbered order I want) for each Unique Item of column C. If the pivot table can automatically vlookup or index:match then it might work.

    However I'd prefer to stick with VBA Code or excel formula's to achieve my goal.

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need a way to automatically sort into unique items in a particular order...

    A pivot would seem a logical and efficient approach here.

    If we assume content of Col C changes but M:O does not then I would be inclined to do the following:

    Please Login or Register  to view this content.
    Now, via your Excel Options -> Advanced -> General Section (towards bottom) -> Edit Custom Lists: create a new Custom List by Importing M4:M60 as the source

    Now, create a Pivot table off M3:P60 and set FOUND as Page Field / Report Filter (to be set to TRUE) and ITEM as Row Field / Label.

    The Pivot should sort the Found items per M3:M60 order (by virtue of your new Custom List).

  5. #5
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Re: Need a way to automatically sort into unique items in a particular order...

    That's not a bad idea. Kinda complicated but it works. Only setback is occasionally there are new items entered in M3:M60 so I would have to update my custom list each time. Other con is having to refresh pivot table each time the list changes. I can't help but think there has to be a more "hands free" way to do this.

    Thanks

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need a way to automatically sort into unique items in a particular order...

    You can use formulae - the PT was based on assumption that M3:M60 did not alter.

    I'd still keep the helper column in P (extend for excess capacity) but change the TRUE/FALSE flag to an incrementing number construct and use a basic INDEX/MATCH approach thereafter to retrieve items 1 to n (n being MAX of P)

    There's little value in analysing C to generate the unique list as you're just adding unnecessary overhead.
    Last edited by DonkeyOte; 01-05-2011 at 12:58 PM. Reason: said M meant P

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need a way to automatically sort into unique items in a particular order...

    I realised in the above I referred originally to M whereas I meant P of course.

    Given I probably added to confusion, see below for an example of my ramblings:

    Please Login or Register  to view this content.
    Then assuming you want the found items in Col R

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Re: Need a way to automatically sort into unique items in a particular order...

    Hey that's it! That's the way to do it, I appreciate everyone's time thank you!

+ 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