+ Reply to Thread
Results 1 to 3 of 3

Counting unique entries in a column, not excluding nulls

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    10-21-2011
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    513

    Counting unique entries in a column, not excluding nulls

    Hi there,

    I'm trying to count the # of unique entries in a column, and found this formula, but can't get it to work. Let's just say 10000 is big enough right now.

    =SUM(IF(FREQUENCY(IF(LEN(A2:A10000)>0,MATCH(A2:A10000,A2:A10000,0),""), IF(LEN(A2:A10000)>0,MATCH(A2:A10000,A2:A10000,0),""))>0,1))
    also attaced the file.

    Thanks for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Counting unique entries in a column, not excluding nulls

    It's a matrix formula (and you don't end the formula with CTRL+SHIFT+ENTER) instead of just enter.

    The result of the formule is 23.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting unique entries in a column, not excluding nulls

    The data looks like numbers but it's TEXT.

    With the data as is, try this array formula**:

    =SUM(IF(FREQUENCY(IF(A2:A10000<>"",MATCH(A2:A10000,A2:A10000,0)),ROW(A2:A10000)-ROW(A2)+1),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    If you convert the TEXT numbers to numeric numbers, try this normally entered formula:

    =SUM(--(FREQUENCY(A2:A10000,A2:A10000)>0))



    Quite a difference, eh?

    You can convert the TEXT numbers to numeric numbers by doing this...

    Select the range A2:A10000
    Goto the Data tab>Text to Columns
    Click Finish
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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