+ Reply to Thread
Results 1 to 5 of 5

distinct lists

  1. #1
    Registered User
    Join Date
    02-24-2009
    Location
    Windsor, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    distinct lists

    Hi all,

    I have a large list of names with many duplicates. Alongside these names in another column I have a revenue figure.

    How do I first output in a separate list, the top 25 of those names distinctly ordered by rank of the sum of the revenue figures?

    Many thanks!!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: distinct lists

    Hi,

    have you tried a pivot table?
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    02-24-2009
    Location
    Windsor, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: distinct lists

    Hi,

    No - I won't be using a pivot table because this is more complex in the grand scheme of everything I'm doing due to presentation etc....

    I can easily filter on the table using tools like this but I'm in a different situation.

    So need to be able to return a distinct list of values off the back of a list of duplicates to start with!

    Cheers

  4. #4
    Registered User
    Join Date
    02-24-2009
    Location
    Windsor, England
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: distinct lists

    Figured it out!

    You can connect to your own data table as a data connection via ODBC.

    Then run SELECT DISTINCT sql on it :D

    Being able to run MS SQL on your data tables is immense power that has been around for ages!

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: distinct lists

    If you don't mind, please post your code.

    I have used that method using ADO but not as a data query. It is usually pretty fast.

    Here is an example where I filled some listbox controls on a sheet.
    Please Login or Register  to view this content.
    Here is a Filter/Sort method. I have used this method to do my scratch work in a hidden sheet.
    Please Login or Register  to view this content.
    Another method is to use a Collection or Dictionary to get unique values and then sort.

    Here is an array method.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 03-12-2009 at 02:12 PM.

+ 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