+ Reply to Thread
Results 1 to 6 of 6

Count unique items in column.

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173

    Count unique items in column.

    I am trying to count the number of unique entries in column F of worksheet with ~30,000 rows and I am using Excel 2000. I tried using a pivot table but keep getting an error becuase of too much data.

    I orginally posted in functions forum but didn't get any response so I am thinking I posted in wrong forum and this is a programming issue that needs a macro.

    https://www.excelforum.com/showthread.php?p=647266

    Any comments are really appreciated. If there is no solution, please let me know. Thanks.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =SUMPRODUCT((A1:A1000<>"")/COUNTIF(A1:A1000,A1:A1000&""))
    Note Sumproduct won't work for a whole column

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    04-17-2008
    Location
    Yorkshire
    Posts
    79
    something like:

    Please Login or Register  to view this content.
    ...borrowed from bob at the oz forum

    it doesnt much like 30000 lines tho, i use something similar on list of postcode and it grinds my machinie to a halt.

    *will have to be quicker digging out those examples in future*

    VBA solution

    Please Login or Register  to view this content.
    Last edited by mikeyfear; 06-18-2008 at 06:09 PM.
    -----------------------------------------------
    Trying to give and take in equal measure!
    Self professed excel bodger!
    -----------------------------------------------

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173
    Formula works perfect. Exactly what I needed. One more question on the formula.

    At the end of the formula is
    Please Login or Register  to view this content.
    What is this part of the formula used for (the &"")? I took this part out of the formula and it still appears to be working correctly.

    Thanks

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    This is probably more efficient for 30000 rows......

    F1 needs to have a header, e.g. "names", data to be counted in F2:F30000

    In D1 enter "criteria" [without quotes]
    In D2 enter this formula

    =COUNTIF($F$2:F2,F2)=1

    and then in D3 enter this formula to count uniques

    =DCOUNTA($F$1:$F$30000,1,$D$1:$D$2)

  6. #6
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,173
    All solutions presented are working. Thanks to all for your help.

+ 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