+ Reply to Thread
Results 1 to 3 of 3

Count unique values real-time, need a faster way

  1. #1
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Count unique values real-time, need a faster way

    Cannot upload a spreadsheet at the moment unfortunately but I will try to explain clearly

    I have a template sheet which usually has 50k to 75k rows, and about 70 columns pasted into it.

    What the template does is generate spreadsheets based on each unique value in a selected column.

    The template file itself will be used for a variety of applications, so the column the file is to be split by can have variable data in it.

    I created a simple form to simplify the process of selecting a column. It contains a large listbox which populates with the Headers pasted into the template;

    Please Login or Register  to view this content.
    Nothing too exciting there...

    On the bottom, I have a label (label3) which is to indicate the total number of spreadsheets that will be created. This is based on the number of unique values in the selected column. My initial attempt was to use a helper sheet (TEMP) with some pre-set formulas which listed the header columns from the DUMP sheet, and a formula to count unique values in the DUMP sheet, and use a worksheetfunction.vlookup to extract the value

    Please Login or Register  to view this content.
    While this method works fine in testing with a couple dozen rows, having 80,000 rows and 100 columns makes things run awful slow.

    I attempted a VBA solution to count the uniques per column but it was equally as slow....I forget where that code was from though :\

    Any ideas? Let me know if more information is needed.
    Last edited by Speshul; 03-10-2015 at 02:06 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Count unique values real-time, need a faster way

    You could try copying the column of values into a new sheet and use the remove duplicates functionality to get to a unique set of values. You can then use this to populate you list. To get the syntax, try recording a macro which does the above manually.

    I've used this approach successfully on datasets of a similar size.
    Martin

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Count unique values real-time, need a faster way

    I'll give it a shot - it would need to repeat each time a different column is selected from the listbox though.

    Another thought I had right after I posted was to have a pivot table somewhere that dynamically changed row headers with a count for values as I clicked, since pivots seem to count unique very efficiently

+ 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. Real time auto increment a unique number when submitting a userform
    By ray.kanata in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-03-2015, 10:27 AM
  2. [SOLVED] Unique Total Value Count per Unique Lookup Values
    By KnightVision in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-02-2014, 05:03 AM
  3. Count Unique Values Of A Cell over time
    By samsonuk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-09-2013, 04:46 AM
  4. [SOLVED] tracking real-time values
    By okcsteve in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-11-2013, 06:46 AM
  5. [SOLVED] copy paste updated values in real time
    By excelpea in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-03-2012, 11:53 PM

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